Message ID | 20190228221933.2551-61-casey@schaufler-ca.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
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-2.web.codeaurora.org (Postfix) with ESMTP id B002B18B7 for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 28 Feb 2019 22:20:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0A682F431 for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 28 Feb 2019 22:20:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F09D2FC90; Thu, 28 Feb 2019 22:20:29 +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,DKIM_SIGNED, DKIM_VALID,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 405C82F431 for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 28 Feb 2019 22:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732134AbfB1WU2 (ORCPT <rfc822;patchwork-linux-security-module@patchwork.kernel.org>); Thu, 28 Feb 2019 17:20:28 -0500 Received: from sonic302-28.consmr.mail.gq1.yahoo.com ([98.137.68.154]:45901 "EHLO sonic302-28.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731964AbfB1WU1 (ORCPT <rfc822;linux-security-module@vger.kernel.org>); Thu, 28 Feb 2019 17:20:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;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c_ouJsEK1KkYPbrlj7NMlrtiA3bhTd6tLsslAdCNV ZIrwZGHQEhRAiRxrheKFF2.Jl8xWlMhO12BP7j9Jg7MFssa6tx.gUBisUffnGTNoEKLm82q7qtZG W_soBSrkeq6gaoyokchL9686fvg6Xz.W1gqHG0fcaF3Av9cQ7dfBlPLVW86_g3ntruA2M5aelHQM e4QP8_UvQpVN4navimpwWTpyeH.wtAkCM_4Ysz61j9311LyYuNXgGZb54bx620d6pomjQxDfrJay 8Hf2gW042qkFprzY1r8FHVQCLku5SAc66.uXoFr0Xpg7ZPaOaK_oV0LoHrlY68Qm0gJpMkZ946Dk rWuVxhFYfdt6vUhW9L9IF7fzkvuRLJYMYEonEe4Ese4rlXK3zt5zGFtbv2FooMW.LBTpV7V0hPNd x5NYFei_zhnN0thMK.9AZ1Jh2qex.KQNuV0EqiV28FWl6w.g5Er97BxH219bU7z1QCqAGVDZVhlC j9iIzgl6N9c7VZmd4MzuZaIvhfk6NHYjZY3at5iOm8PR.ti0- Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Thu, 28 Feb 2019 22:20:26 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO localhost.localdomain) ([67.169.65.224]) by smtp421.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID d90148b291d74b44c78573c559ceeae0; Thu, 28 Feb 2019 22:20:21 +0000 (UTC) From: Casey Schaufler <casey@schaufler-ca.com> To: jmorris@namei.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Cc: keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, paul@paul-moore.com Subject: [PATCH 60/97] kernfs: remove lsm_context scaffolding Date: Thu, 28 Feb 2019 14:18:56 -0800 Message-Id: <20190228221933.2551-61-casey@schaufler-ca.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190228221933.2551-1-casey@schaufler-ca.com> References: <20190228221933.2551-1-casey@schaufler-ca.com> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: <linux-security-module.vger.kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
LSM: Complete module stacking
|
expand
|
diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c index 6db050b7c6ab..3d47fd74cc8c 100644 --- a/fs/kernfs/inode.c +++ b/fs/kernfs/inode.c @@ -135,20 +135,15 @@ int kernfs_iop_setattr(struct dentry *dentry, struct iattr *iattr) return error; } -static int kernfs_node_setsecdata(struct kernfs_iattrs *attrs, void **secdata, - u32 *secdata_len) +static int kernfs_node_setsecdata(struct kernfs_iattrs *attrs, + struct lsm_context *cp) { - void *old_secdata; - size_t old_secdata_len; + struct lsm_context old_context; - old_secdata = attrs->ia_context.context; - old_secdata_len = attrs->ia_context.len; + old_context = attrs->ia_context; + attrs->ia_context = *cp; + *cp = old_context; - attrs->ia_context.context = *secdata; - attrs->ia_context.len = *secdata_len; - - *secdata = old_secdata; - *secdata_len = old_secdata_len; return 0; } @@ -363,7 +358,7 @@ static int kernfs_security_xattr_set(const struct xattr_handler *handler, return error; mutex_lock(&kernfs_mutex); - error = kernfs_node_setsecdata(attrs, (void **)&lc.context, &lc.len); + error = kernfs_node_setsecdata(attrs, &lc); mutex_unlock(&kernfs_mutex); if (lc.context)
Change the parameters to kernfs_node_setsecdata from a data/length pair to a lsm_context struct as both the function it calls and the function that calls it want that. Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> --- fs/kernfs/inode.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)