From patchwork Sun Jan 15 15:19:02 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: 9517505 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 624C9607D4 for ; Sun, 15 Jan 2017 15:19:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54FDB200E7 for ; Sun, 15 Jan 2017 15:19:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46B5328383; Sun, 15 Jan 2017 15:19:19 +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 DDEE7200E7 for ; Sun, 15 Jan 2017 15:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751045AbdAOPTR (ORCPT ); Sun, 15 Jan 2017 10:19:17 -0500 Received: from mout.web.de ([212.227.15.4]:55517 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751129AbdAOPTQ (ORCPT ); Sun, 15 Jan 2017 10:19:16 -0500 Received: from [192.168.1.2] ([78.49.147.199]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MAvVk-1cL7bY11wS-009xS5; Sun, 15 Jan 2017 16:19:04 +0100 Subject: [PATCH 19/46] selinux: Return directly after a failed next_entry() in range_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: <9e75f8b7-1275-b2e6-a01c-d0c5ebac1a44@users.sourceforge.net> Date: Sun, 15 Jan 2017 16:19:02 +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:9v5PkobS6yPca5n3aGiJw7yU9ZVaoywADWFjD27ovi2nWALhQ4p nOYMQMWrQ2Njni0Hxdne13+FioUb53nyv3ya27hxiYz55r0TR5D218TnAxCjtQeQ7Km0k5t fLt6WfiGaxd1bnOKjfu2laKW57uJWhLHR7A+L5YYkSNQplnE6nw38byUOtRtX+6Bmz9iaB3 mNfLQrNKTokjiufi2VIJA== X-UI-Out-Filterresults: notjunk:1; V01:K0:WAr1TILLQqM=:uEjnq4VhDS0teO82CWWOxB AWlOZ8omZQJI5eCi0sqq/dAfYC4saqCZWfC6sQUTaG0buPBfhXxxjNFkFf7kR1yOmTWuiNbiM QNOpXncTa1y7W5hvrvi8vHQ24DCA7VfgQxzpDN5ZZfld4z5p9uK0bkfxMqK68XcZzlTbll5te vWCFKauUY5e29kMeozBxyoNVf8tYfIYR0iT2dy8ECnlIbtIxjKi+WOGEE5hggfeSkoISxioJd QYPUi/CiZ0qVExG84/p9v1tRZ84+NQuF0fJAH/o5w7NhRUO07SWH474gMxlRww/TIQ0vyU14R PuSIP1fq3Wg3YFyKoEQ28Cq8cWA5wtSa3J5wTvr+edwzh+0r+frH9npSUe6km7ZDZ21riEeP1 q6ZG/pUBV/1nEw1bZi405JENPXNwD5DpCxB74eVDMWT0IcIpIcbC1ohBc7nFQYaIZAx8bvHSi /2p8WNThaEDfNvJLpQSqSOiRF2gOGCWnzB+8rRjQOlJ7j2EZFdtPl/ko9wxAkhwwaWzJnPX43 3y4QORAf1hnG22mJYNKs9Xx42lzcbQ+u+BxM1+/P3mkHXhiK0RgeYi3rF8vRRQVOUKsRjXJmg nXdOR2LkIBCLU4s16O7KhQautIE2WsuNjNBKLiMEPxzpFKRpIIj/xLSWQqZZLL696TcfUY1v6 mnXHkP9RfcJ9TXl1jWXFmnp9RQSvQNWV90qryMekgnMMana6+8Kv9y4A9F3BsJ4aEC/8zCXIY 8OQaiN0Cmxrcq+BWSulzv9ZB5rNRSmkoVXL7luZVqyjVxosRN50jCcq/dHZCG4TgP1zFMij9d 9PumrD2 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 19:35:59 +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 5f122e846332..a696876fc327 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -1850,7 +1850,7 @@ static int range_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++) {