From patchwork Fri May 11 00:56:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 10392805 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 4671160153 for ; Fri, 11 May 2018 00:56:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B1B028D42 for ; Fri, 11 May 2018 00:56:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F84228D4F; Fri, 11 May 2018 00:56: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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 6E3C428D42 for ; Fri, 11 May 2018 00:56:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751219AbeEKA4T (ORCPT ); Thu, 10 May 2018 20:56:19 -0400 Received: from sonic311-29.consmr.mail.ne1.yahoo.com ([66.163.188.210]:36332 "EHLO sonic311-29.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752161AbeEKA4Q (ORCPT ); Thu, 10 May 2018 20:56:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1526000176; bh=g1TAnpJXJZB0e1HO/Y7kG8s22Pao1DWLqfmO/+/ZSDQ=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=FieDk6tUPT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ne1.yahoo.com with HTTP; Fri, 11 May 2018 00:56:16 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.105]) ([67.169.65.224]) by smtp426.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 8cdc59684a8da2cba5897d46226dbf75; Fri, 11 May 2018 00:56:13 +0000 (UTC) Subject: [PATCH 22/23] LSM: Fix setting of the IMA data in inode init To: LSM , LKLM , Paul Moore , Stephen Smalley , SE Linux , "SMACK-discuss@lists.01.org" , John Johansen , Kees Cook , Tetsuo Handa , James Morris References: <7e8702ce-2598-e0a3-31a2-bc29157fb73d@schaufler-ca.com> From: Casey Schaufler Message-ID: Date: Thu, 10 May 2018 17:56:10 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <7e8702ce-2598-e0a3-31a2-bc29157fb73d@schaufler-ca.com> Content-Language: en-US Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Casey Schaufler Date: Thu, 10 May 2018 16:23:47 -0700 Subject: [PATCH 22/23] LSM: Fix setting of the IMA data in inode init Fix a missing assignment in the inode security initialization. The EVM entry was not being set correctly. Signed-off-by: Casey Schaufler --- security/security.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/security.c b/security/security.c index ef51783e967e..571643cc7256 100644 --- a/security/security.c +++ b/security/security.c @@ -941,6 +941,7 @@ int security_inode_init_security(struct inode *inode, struct inode *dir, &lsm_xattr->value_len); if (rc == 0) { lsm_xattr++; + evm_xattr = lsm_xattr; if (ret == -EOPNOTSUPP) ret = 0; } else if (rc != -EOPNOTSUPP) { @@ -950,7 +951,7 @@ int security_inode_init_security(struct inode *inode, struct inode *dir, } if (ret == 0) { - rc = evm_inode_init_security(inode, lsm_xattr, evm_xattr); + rc = evm_inode_init_security(inode, new_xattrs, evm_xattr); if (rc == 0) rc = initxattrs(inode, new_xattrs, fs_data); }