Received: by 10.192.165.148 with SMTP id m20csp4980496imm; Tue, 8 May 2018 19:07:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoeHkvkqrAvmjrC1dorGW2XDaCuzMd61Bu7+9M6sIxRZxLI8+dqdc3FOk5AkwFLCwJvMTL4 X-Received: by 2002:a17:902:1c8:: with SMTP id b66-v6mr42747940plb.156.1525831666753; Tue, 08 May 2018 19:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525831666; cv=none; d=google.com; s=arc-20160816; b=pzNrwibOmqHi35eS+xnbNl3FIYUxXoAleMUUiyhw4TC9A0XvZjLPViww96njCJaXzi 2f/tNC5+pBiT8yK/A41tC2OvK/JdfSm11R8xa7sPmGOx81RzZtA0GzU98Gstd7kM99SZ rUOPkogPz2V5Cw9peCQuf2fLwdYIrGVGX1icU/AuDQJ6kIupFJ4qLG4SoNyRwVauVme7 Fij0mQYwtx6bEU4gyJ3zY7E7lwFtg6zrW8H+q2Sj3Ux/rG3gZTD7VJH7w81aRAczpVhi gXSADNEM5Jkmr9lKXNsseme9mWaNzzS5CTUJyyP/8WlcNp3w4CBGxyS2iqBq0UaSOhC+ v4Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=eVUYFwzVxXWhNr8xkjZePW/TfzwJKR/4+M9HOH0X3FQ=; b=S3QiXyIB1hbVJVGsz+VIJCAABExhVfHZEdYXxmFRm0kmy9PaJaW6B250VS06BkKRC8 SQ7wCC85JHzm749L4Dxd49Kug40gFQwxwv/Fasur5+4IzbDAoAYcEda7u0789y8HxFFV PqVO0dbDsDgbcaMw9H/xZqqKd2dO0Tl9p9eNZv8WkDtfPSKhHXc452s7D7nti50RztVt yu6aFdpBVW9eHLUW6UVl6tTL7pEj9TH4LOPbUiUoF1dfULEcgvwURmlVL7RSK2+BwE6p lWcyelJzPLnexk9tEtVVfaTLx64Ac7Xwyx+HDT9D5ArkrohPzBEbX2isnPKu9unFRKb2 ZSeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=G2rpqxB4; 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 43-v6si11483079plb.511.2018.05.08.19.07.32; Tue, 08 May 2018 19:07:46 -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; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=G2rpqxB4; 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 S933528AbeEICHM (ORCPT + 99 others); Tue, 8 May 2018 22:07:12 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:50747 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932115AbeEICHF (ORCPT ); Tue, 8 May 2018 22:07:05 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B33A820D83; Tue, 8 May 2018 22:07:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 08 May 2018 22:07:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=eVUYFwzVxXWhNr8xkjZePW/TfzwJK R/4+M9HOH0X3FQ=; b=G2rpqxB4Y6zWvaApH1DgR1wQYgLg6zDOBpIX7y8wCY8dc D26secXieIf7XfQE/iD9E1Aru/ZMT67L8ucjrk810Qtte6vtMQ2XhPJcaZie8oA2 jkQ/ZoMU8Re9WAeJQBOcaqyaMcLsAM7/m4ydtwrxHez0b06ekr/ApJaMSy3+K1Jx +QbrmH++Y4r12mIgiEsV59jp1H43q3+5m81p8Iss5V/6/1zOqR+OGWA3too8trUf hvC9hBfrF0NwH0DAJluXdm+DmMRN3IIiYCpDhGNobl66JIVMQ6Roj+v6r4zrztHK UZ1EipprYBLVGCjsea+2HGfmT6o14C11M4uj2TvaQ== X-ME-Sender: Received: from localhost (ppp121-44-193-109.bras1.syd2.internode.on.net [121.44.193.109]) by mail.messagingengine.com (Postfix) with ESMTPA id E232AE50A8; Tue, 8 May 2018 22:07:03 -0400 (EDT) Date: Wed, 9 May 2018 12:07:00 +1000 From: "Tobin C. Harding" To: Richard Guy Briggs Cc: Linux-Audit Mailing List , LKML , Linux NetDev Upstream Mailing List , Netfilter Devel List , Linux Security Module list , Integrity Measurement Architecture , SElinux list , Eric Paris , Paul Moore , Steve Grubb , Ingo Molnar , David Howells Subject: Re: [PATCH ghak81 RFC V1 4/5] audit: use inline function to set audit context Message-ID: <20180509020700.GE7517@eros> References: <2f0566af8ccafdaf400a3d002cb4aef9b80e44cf.1525466167.git.rgb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2f0566af8ccafdaf400a3d002cb4aef9b80e44cf.1525466167.git.rgb@redhat.com> X-Mailer: Mutt 1.5.24 (2015-08-30) User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 04, 2018 at 04:54:37PM -0400, Richard Guy Briggs wrote: > Recognizing that the audit context is an internal audit value, use an > access function to set the audit context pointer for the task > rather than reaching directly into the task struct to set it. > > Signed-off-by: Richard Guy Briggs > --- > include/linux/audit.h | 8 ++++++++ > kernel/auditsc.c | 6 +++--- > kernel/fork.c | 2 +- > 3 files changed, 12 insertions(+), 4 deletions(-) > > diff --git a/include/linux/audit.h b/include/linux/audit.h > index 93e4c61..dba0d45 100644 > --- a/include/linux/audit.h > +++ b/include/linux/audit.h > @@ -235,6 +235,10 @@ extern void __audit_inode_child(struct inode *parent, > extern void __audit_seccomp(unsigned long syscall, long signr, int code); > extern void __audit_ptrace(struct task_struct *t); > > +static inline void audit_set_context(struct task_struct *task, struct audit_context *ctx) > +{ > + task->audit_context = ctx; > +} > static inline struct audit_context *audit_context(struct task_struct *task) > { > return task->audit_context; > @@ -472,6 +476,10 @@ static inline bool audit_dummy_context(void) > { > return true; > } > +static inline void audit_set_context(struct task_struct *task, struct audit_context *ctx) > +{ > + task->audit_context = ctx; > +} If audit_context is an internal audit value why do we set it when CONFIG_AUDITSYSCALL is not set? thanks, Tobin.