From patchwork Sun Jan 15 15:11:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9517475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ED37D607D4 for ; Sun, 15 Jan 2017 15:11:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1E6E28445 for ; Sun, 15 Jan 2017 15:11:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6B5D2845B; Sun, 15 Jan 2017 15:11:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BA0D28445 for ; Sun, 15 Jan 2017 15:11:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751205AbdAOPLd (ORCPT ); Sun, 15 Jan 2017 10:11:33 -0500 Received: from mout.web.de ([212.227.15.3]:50797 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbdAOPLc (ORCPT ); Sun, 15 Jan 2017 10:11:32 -0500 Received: from [192.168.1.2] ([78.49.147.199]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MRiZt-1c01DL0EDB-00T0Ms; Sun, 15 Jan 2017 16:11:18 +0100 Subject: [PATCH 11/46] selinux: Return directly after a failed next_entry() in genfs_read() To: linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, Eric Paris , James Morris , Paul Moore , "Serge E. Hallyn" , Stephen Smalley , William Roberts References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <767b0ef6-2693-2de3-897f-c1989870676f@users.sourceforge.net> Date: Sun, 15 Jan 2017 16:11:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:eJgnkqd34kwq8WYyEZjC603IPt8ZiW6hT1A34Bf90SaVduGF1U6 esIObxUeAKSOcSIyBVJGv7E7zibV5ozXqWN3WRB+kjrewjnnzM5+fw83YlAPQbcR319U3zy 26977DHyH09bF3kZUzRkbYIBGthcLDuSNCK7oaRUcOmbwiEIqgo1/VrmvE53RWhATdkKpY5 /PlviZGn/Loxl9iohZu6w== X-UI-Out-Filterresults: notjunk:1; V01:K0:qmDG27WNI98=:vzO9A7dRiA0W4WAObWgG6u N0jBnli7cxy/UgAMVShm/xeCaoqAg+SyCaaHITL1j2GiQ2tJFGQGIR+gARFU/O42ywlGPx/Jp GfHgb2SmrkXB6tmE2XSyCst9gORBU7d0eZPkkjUElbvhwZ9HID+8JFRB7ClZbBhlsOXVQRncr 9NoM5CYO3ya7gvfOipoRyrLoODBB2fR3TnNib9DSeHAIBC/frusA50mN2wlmu+E7/lqrF1gG0 rDSfbdA5EVimzFmO2H+5n0tcaG0mqeNGza2B7WKk0shPwL5KTl6wa5Ah8AkC+vKWtrNx9y6Gn a4GJdKkLg6rVyJB4RsR2CoA+NvL7QE09SYMBTr8G0p6dziY8FqMl6e3LSRnQCxenR0INWstQz 6r7qPPcvMXG49XoVHEBJ6RJyDzA5fBqflOXVZofIQEs0i70B75w0gEf315j54FBmmgT10jZ53 AzCpv1/mo9ZvDYriGA0hE4Xu6ZzzhdMzc/KXgmvR5AQKBTgTnv0pQqN5mskB8GdR+uCWAw4aR +7LrrxrS5+0lh/2nYQoHgB57vZPq2eU3HIzCbejA8sWCZq7czzlv8nFMnwfEtzoe8H6hkO5Rn Rqgq7WL8KEd+LK62tku0tXKHsqRDyhVG/RwWAD44QMmVhvxtLDHT6g89XXj3HMxRjqwIqq/yw MAbeD2FO87WqT6sbN9BO+hfvQLOTtKeifY7UYwdk9EgoqdmoJz51eW/Ddrm6fZzjPrJazpH8v qQ7YvFJoNsdeL9c2DbRu6Ea8ewDCCXjb8+V567RaSBKtD/TKt/vBGdXWiTijuTATy0zpUhPo1 FX9Gv+A Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 14 Jan 2017 16:34:25 +0100 Return directly after a call of the function "next_entry" failed at the beginning. Signed-off-by: Markus Elfring --- security/selinux/ss/policydb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 506b0228d1f1..754f829d2027 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -2004,7 +2004,7 @@ static int genfs_read(struct policydb *p, void *fp) rc = next_entry(buf, fp, sizeof(u32)); if (rc) - goto out; + return rc; nel = le32_to_cpu(buf[0]); for (i = 0; i < nel; i++) {