armbian-build/patch/kernel/mvebu64-next/general-integrity-silence-warning-when-CONFIG_SECURITYFS-is-not-enabled.patch

86 lines
3.7 KiB
Diff

From patchwork Mon Jun 4 14:05:21 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Sudeep Holla <Sudeep.Holla@arm.com>
X-Patchwork-Id: 10446661
Return-Path: <linux-security-module-owner@kernel.org>
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
5B05060375
for <patchwork-linux-security-module@patchwork.kernel.org>;
Mon, 4 Jun 2018 14:05:34 +0000 (UTC)
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5195B29048
for <patchwork-linux-security-module@patchwork.kernel.org>;
Mon, 4 Jun 2018 14:05:34 +0000 (UTC)
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
id 44E6E2909C; Mon, 4 Jun 2018 14:05:34 +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 22F2A29048
for <patchwork-linux-security-module@patchwork.kernel.org>;
Mon, 4 Jun 2018 14:05:33 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1753237AbeFDOFc (ORCPT
<rfc822;patchwork-linux-security-module@patchwork.kernel.org>);
Mon, 4 Jun 2018 10:05:32 -0400
Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:43740 "EHLO
foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
id S1753163AbeFDOFc (ORCPT
<rfc822;linux-security-module@vger.kernel.org>);
Mon, 4 Jun 2018 10:05:32 -0400
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249])
by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 650451435;
Mon, 4 Jun 2018 07:05:31 -0700 (PDT)
Received: from usa.arm.com (unknown [10.1.210.28])
by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id
4D4C13F59D; Mon, 4 Jun 2018 07:05:30 -0700 (PDT)
From: Sudeep Holla <sudeep.holla@arm.com>
To: linux-security-module@vger.kernel.org
Cc: Sudeep Holla <sudeep.holla@arm.com>, James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>, Matthew Garrett <mjg59@google.com>
Subject: [PATCH] integrity: silence warning when CONFIG_SECURITYFS is not
enabled
Date: Mon, 4 Jun 2018 15:05:21 +0100
Message-Id: <1528121121-3959-1-git-send-email-sudeep.holla@arm.com>
X-Mailer: git-send-email 2.7.4
Sender: owner-linux-security-module@vger.kernel.org
Precedence: bulk
List-ID: <linux-security-module.vger.kernel.org>
X-Virus-Scanned: ClamAV using ClamSMTP
When CONFIG_SECURITYFS is not enabled, securityfs_create_dir returns
-ENODEV which throws the following error:
"Unable to create integrity sysfs dir: -19"
However, if the feature is disabled, it can't be warning and hence
we need to silence the error.
Cc: James Morris <jmorris@namei.org>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Matthew Garrett <mjg59@google.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
security/integrity/iint.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 149faa81f6f0..8082491876f9 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -218,7 +218,7 @@ void __init integrity_load_keys(void)
static int __init integrity_fs_init(void)
{
integrity_dir = securityfs_create_dir("integrity", NULL);
- if (IS_ERR(integrity_dir)) {
+ if (IS_ENABLED(CONFIG_SECURITYFS) && IS_ERR(integrity_dir)) {
pr_err("Unable to create integrity sysfs dir: %ld\n",
PTR_ERR(integrity_dir));
integrity_dir = NULL;