From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751433AbdAOPoU (ORCPT ); Sun, 15 Jan 2017 10:44:20 -0500 Received: from mout.web.de ([212.227.15.4]:49876 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbdAOPoS (ORCPT ); Sun, 15 Jan 2017 10:44:18 -0500 Subject: [PATCH 44/46] selinux: Adjust two checks for null pointers 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: Date: Sun, 15 Jan 2017 16:44:04 +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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:JBLBeLHU2rqTBU29HM3euneW4DtQLIuV98fy+oFQ9G742tRf/Ba xCTlDbzASEcCgivydXNlbyURJLRnh4PRuVobx17dw8FWLUrHX+Vra9BubJwHFU07dh75jF8 tqdmNlDjQmHItXvo4f3mizQeBTI5nX/+7oI5VVjPeeU4KO/iwWrhqw8xWp3zljsIlmYbwrT kmamNfAGqRt1SptShQB/A== X-UI-Out-Filterresults: notjunk:1;V01:K0:RFhlbeHFDgU=:xpMhzScqGBLzM5U6atsMRE WD1gcUpS+OKQUVNO02eErL79bHBmIeh/NYCsGDGHXJ6LKnatWgnYoAgkQN1DHNm64ESgT1qwn eFIR1YOQ917Cw9GI+Vkzc35hSwfqnnnKStc3ttCIJnwaPMvyl3uOJflcU73Rs6RllrGRTna8E 6j6EHLh1YARrjUMK3i3fEZ1c9X91mr0dWgcX0lHtpsfYD37Td4nkt5Z8qABBuQssElu890ziw O59xJodPFJgsC7Is3D0syBIabSC6QZxPmtRTKEaj7vVlMf45aREAja0j0JbUCi7ZJKheE9jET yICu13volsqUO80Wj6bpQEJS1otBrE9u+vBDt+HPxw5oKpfso6Z1MewrM1X28b8dn+OSygfm+ DC1EDX71X/r9yVdyHNWeiaA3plUmWa3IlWFaPkoDSoz3gTBKo82eBTIPhgN7/9/sHRGvChFeK 74zZ53I0FLrm3m6EgifmLVo3wynpxUXtbOWVHNMxrceGG6Z5DpZ4GzHc5WvHV5ojkAn23fMYs diUlKGbiEmSCRobqBtIoqOCGGC+3zJJE+Nn9cdSj0mZsIPmTQOO4cVHGh+zFH8BCXBKmwSDfZ am3A+X2XCiypUHgLIPWQ1GSLieQlShUTj/DOlJCSes8o95v2EzaFXfTr2NqdpfUuACILOXPuY hlj3ndYy3R4mk4i3VQ8e1SBBFtyzT5C4CaryLIFWZGJfn+aI9NTcYhccz7FgtIvEJ50aeUyl1 HJqhyUdMZMKhkQ82gl+LPHLZ5XUqLS4LbLEZKSq/emLWP6t4cZcwpDESLwPFOcdYnJyC7F61s LkcKXdK Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Sun, 15 Jan 2017 13:30:20 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written !… Thus fix affected source code places. Signed-off-by: Markus Elfring --- security/selinux/ss/sidtab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/selinux/ss/sidtab.c b/security/selinux/ss/sidtab.c index c9533b21942b..f6915f257486 100644 --- a/security/selinux/ss/sidtab.c +++ b/security/selinux/ss/sidtab.c @@ -54,7 +54,7 @@ int sidtab_insert(struct sidtab *s, u32 sid, struct context *context) } newnode = kmalloc(sizeof(*newnode), GFP_ATOMIC); - if (newnode == NULL) { + if (!newnode) { rc = -ENOMEM; goto out; } @@ -98,7 +98,7 @@ static struct context *sidtab_search_core(struct sidtab *s, u32 sid, int force) if (force && cur && sid == cur->sid && cur->context.len) return &cur->context; - if (cur == NULL || sid != cur->sid || cur->context.len) { + if (!cur || sid != cur->sid || cur->context.len) { /* Remap invalid SIDs to the unlabeled SID. */ sid = SECINITSID_UNLABELED; hvalue = SIDTAB_HASH(sid); -- 2.11.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Sun, 15 Jan 2017 15:44:04 +0000 Subject: [PATCH 44/46] selinux: Adjust two checks for null pointers Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, Eric Paris , James Morris , Paul Moore , "Serge E. Hallyn" , Stephen Smalley , William Roberts Cc: LKML , kernel-janitors@vger.kernel.org From: Markus Elfring Date: Sun, 15 Jan 2017 13:30:20 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written !=E2=80=A6 Thus fix affected source code places. Signed-off-by: Markus Elfring --- security/selinux/ss/sidtab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/selinux/ss/sidtab.c b/security/selinux/ss/sidtab.c index c9533b21942b..f6915f257486 100644 --- a/security/selinux/ss/sidtab.c +++ b/security/selinux/ss/sidtab.c @@ -54,7 +54,7 @@ int sidtab_insert(struct sidtab *s, u32 sid, struct conte= xt *context) } =20 newnode =3D kmalloc(sizeof(*newnode), GFP_ATOMIC); - if (newnode =3D NULL) { + if (!newnode) { rc =3D -ENOMEM; goto out; } @@ -98,7 +98,7 @@ static struct context *sidtab_search_core(struct sidtab *= s, u32 sid, int force) if (force && cur && sid =3D cur->sid && cur->context.len) return &cur->context; =20 - if (cur =3D NULL || sid !=3D cur->sid || cur->context.len) { + if (!cur || sid !=3D cur->sid || cur->context.len) { /* Remap invalid SIDs to the unlabeled SID. */ sid =3D SECINITSID_UNLABELED; hvalue =3D SIDTAB_HASH(sid); --=20 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html