Received: by 10.213.65.68 with SMTP id h4csp711842imn; Fri, 6 Apr 2018 07:40:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx484CcXG4aNubAhZZeqJKooUJl6+XaqYmyzRb7b12s7R6osRhp5c5BAR25u+2DObkX4M9w/J X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr27478310pla.328.1523025657481; Fri, 06 Apr 2018 07:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523025657; cv=none; d=google.com; s=arc-20160816; b=MGCqq7woUkSFGcM3UGz+U850zrUtUU23HVTIl/lrZA9EMc56H/2tBvL9Kyi6WZy1We obX6XxZFSU06JukTRTYJLmDl6VgZQBjw6fKUJAM9Ee0CvLewzY0A5MQ13Yr3Wel3IFY0 8y2hUh2jH3iuKDEbQTZhEjn0SWXg5A9UcLGN0O9mPgZkOGSROK2lIxJYHKrAi+d2sCHL Faq5HfCxoIO195hsE1bP4dBZ3fr+aiJ/goJLTI5ePwO3nZao6z0bfGUTBb9ZTKs8Gu1j tf8zZkw7gvHkmCGolXRsG2dwzASsO3FMkvlk2MFAAkvb0nJb8DWlOzeyBJ3exswa5H4G fv4A== 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=ZY8u02iOOkjZMxToXNZJwgPWE4/F4TIKRvpU2YGuwC8=; b=HFitl9eYKh838QvsDBdumZ/cQCaCykmcT4H2ZrTqDQ1DUEYm5pZkIvKHLXuHmA1pzG qbhuX5Ca/kbq8m0XQzweciEf4+VfIAxu/6pzSALiMlSpZLQgjhYJ0QIXeVfGB1kCkcKB E/elB7EldKymL1yJ6+mTbdmjbnenu1HLUIb7i5UmU4XGmN8ojiqGcrspsCZyhd6gwDOY lp5KeM2Rr91UAmdiTo50I1HY+qO0m2loyS0oDMYi4VJJeY9fng87BDJ1hDYn6iZDHv+5 rgfGXiY+HiKnCCNxgjg5C/Rt4qj0/20JdGz4IHG9RKIZXnMrhvbXrQZKEZ6QDruWplKl i1Xw== 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 3-v6si8594804plo.475.2018.04.06.07.40.43; Fri, 06 Apr 2018 07:40:57 -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 S1755974AbeDFNfH (ORCPT + 99 others); Fri, 6 Apr 2018 09:35:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58612 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754064AbeDFNfE (ORCPT ); Fri, 6 Apr 2018 09:35:04 -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 CB401DBB; Fri, 6 Apr 2018 13:35:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Stephen Smalley , Paul Moore , Nathan Chancellor Subject: [PATCH 4.9 033/102] selinux: Remove redundant check for unknown labeling behavior Date: Fri, 6 Apr 2018 15:23:14 +0200 Message-Id: <20180406084336.289708652@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 270e8573145a26de924e2dc644596332d400445b upstream. The check is already performed in ocontext_read() when the policy is loaded. Removing the array also fixes the following warning when building with clang: security/selinux/hooks.c:338:20: error: variable 'labeling_behaviors' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] Signed-off-by: Matthias Kaehlcke Acked-by: Stephen Smalley Signed-off-by: Paul Moore Cc: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- security/selinux/hooks.c | 16 ---------------- 1 file changed, 16 deletions(-) --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -406,18 +406,6 @@ static void superblock_free_security(str kfree(sbsec); } -/* The file system's label must be initialized prior to use. */ - -static const char *labeling_behaviors[7] = { - "uses xattr", - "uses transition SIDs", - "uses task SIDs", - "uses genfs_contexts", - "not configured for labeling", - "uses mountpoint labeling", - "uses native labeling", -}; - static inline int inode_doinit(struct inode *inode) { return inode_doinit_with_dentry(inode, NULL); @@ -528,10 +516,6 @@ static int sb_finish_set_opts(struct sup } } - if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors)) - printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n", - sb->s_id, sb->s_type->name); - sbsec->flags |= SE_SBINITIALIZED; if (selinux_is_sblabel_mnt(sb)) sbsec->flags |= SBLABEL_MNT;