Received: by 10.213.65.68 with SMTP id h4csp721501imn; Fri, 6 Apr 2018 07:51:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/aeKpmJEzvusqU4yVCqtN/bxG00x10dw8T9X+v+qwstP6yAYDHadZoc6N1LXmS/znwL46U X-Received: by 2002:a17:902:549:: with SMTP id 67-v6mr28630591plf.276.1523026273147; Fri, 06 Apr 2018 07:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523026273; cv=none; d=google.com; s=arc-20160816; b=ymAxneLNhfsDeBv/ry/KXvXzqX2vj1dt5ekOM/v6NNwbyZiDv74hmMYNH0qvlgh8Al 4trgUmGOI4XVWZ4idz7H4bTn9gm4oDf9GmXjwecJs6LEUUI8QIp/TbdyUYCdhLblZ4CN dkQnR3I7FOa4WU9uLqH8L0Fep1ybtAEgiiFEAENVthaF1cctxGW3Mxzr2FNVHEKCkLDS dMm8wj9Fl2IP9lqOQsVEhH8j4xjGDq/NEQuVyVVdEOoUkbLC49aqLwN63NrIofMDW8wP YMJj5X0BdCoxH/smhmEACmlIVamDPl50Vqt5PjA0SE0snoyp5rz43E4LcK36kCqVZqu4 OM/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=TfBvN/BD+ri3LwNj0TshUqV+T99AIYjuDlbnU8jR2EA=; b=m3ZWLML7MjNz4KjIibOUsvcQ7eJxHfutQG1g2a1GuEdtTlkTq8LJdjni+PaRVQu8dR 5myua16++A38H1UevdDRRBg9yQrM0xKx/hNokYBWBoHbYcjNELgAxh+eT8uy6Y9xu3HA TNYKhZK4zCnAe8amWuLi84FV86rjZzf1TlhlAEQzN/BurYlied/+y0BU3pjI60LIV0Fo m3VMhSaIbIxcZDo5hfcR4GA5685tRLfwqImFleH44+c3ukFrZ/NfdLba8uwlPa177j7C VPIoG3qganLKTusnhMDZ0b+Ls1aGf6rpR3JyMVWE7bE5NZcXyvtiFXmDU+3QZ1SHovFv VQ2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y13si8168114pfd.47.2018.04.06.07.50.59; Fri, 06 Apr 2018 07:51:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755473AbeDFOtx (ORCPT + 99 others); Fri, 6 Apr 2018 10:49:53 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57756 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755512AbeDFNdJ (ORCPT ); Fri, 6 Apr 2018 09:33:09 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CA9FACC9; Fri, 6 Apr 2018 13:33:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Paul Moore , Nathan Chancellor Subject: [PATCH 4.9 019/102] selinux: Remove unnecessary check of array base in selinux_set_mapping() Date: Fri, 6 Apr 2018 15:23:00 +0200 Message-Id: <20180406084334.303108613@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthias Kaehlcke commit 342e91578eb6909529bc7095964cd44b9c057c4e upstream. 'perms' will never be NULL since it isn't a plain pointer but an array of u32 values. This fixes the following warning when building with clang: security/selinux/ss/services.c:158:16: error: address of array 'p_in->perms' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] while (p_in->perms && p_in->perms[k]) { Signed-off-by: Matthias Kaehlcke Signed-off-by: Paul Moore Cc: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- security/selinux/ss/services.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -155,7 +155,7 @@ static int selinux_set_mapping(struct po } k = 0; - while (p_in->perms && p_in->perms[k]) { + while (p_in->perms[k]) { /* An empty permission string skips ahead */ if (!*p_in->perms[k]) { k++;