Received: by 10.192.165.148 with SMTP id m20csp5436956imm; Wed, 9 May 2018 05:11:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo/DD502vAVnkVTQ+p2gl5RlaGoLBgv2SzMj/O3LosHD9nmt82vk1FphjiXr5O2KxOwjYOO X-Received: by 2002:a65:4c4d:: with SMTP id l13-v6mr36136174pgr.46.1525867887818; Wed, 09 May 2018 05:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525867887; cv=none; d=google.com; s=arc-20160816; b=0zAElM2ETtJwSnNoVvoZY46LzutsWOsHquNhT9ruk/1GV6urav87J0VimamfsgWsjF KEOq3RbSFNXN7FBNbx29rSR6SU7//NQjkvbGxieA2CtwyBYw3vypvs7pCWv2SJ8EoJZj LuGbB4M0k2v6n2YrMnLazaA8VrADxfSWfE7fyZDrXYTZ6LDRA5bSaHXHCCQ/pRCUUD7U xk/81bczLZcCU7tRTc/IiJRubxfExDNJjUzbZL3NoRJ9lcxpQLcx8MjsL4XbRHEHI/Wl QcJ7bNXGYQfRC56uViV7jIs/zTG0ZqgtrybBuAqscoxeo+Is8vdJIwV8mC9OuKyNbqgx 8HrQ== 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:arc-authentication-results; bh=ubj01eSkwZqM6JlnmpP8A+TgBSwosaiuFqzJ/vPTus4=; b=g+uijhCblmADK8zyfDaL0n6RnJRF4FdL/GbHE/fJg8ZTd8PTvIZZ33qyawrLZ+zfj8 icWV1inJJcZXmu1QCrvjnTSZAskzx4Bq/IpJpDAd85ktZEwWVpAZMYfPHg/s5LVNx5S/ UhdrLJOr08wLgWJZmJLoxqDYdWEZ+uOprfKAlPXSEpxvDj+w6WaCO0kCfkH6+jVGamXA klpQqGBgT6Z8IXAPv3p/oqYPhTE1txJDr31vmXCkG6y6lCsLw2SQPcSZf1ZqEk6Ny1jR SpojVhQW6zI7f4obexNiHpbnWXbi+l53MqlQfU6j9kpQcYN4RZtQc8Y4an9x5eKiMAey WOVw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p15-v6si18629959pgc.463.2018.05.09.05.11.13; Wed, 09 May 2018 05:11:27 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934900AbeEIMJp (ORCPT + 99 others); Wed, 9 May 2018 08:09:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40888 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934641AbeEIMJl (ORCPT ); Wed, 9 May 2018 08:09:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7B35E4480; Wed, 9 May 2018 12:09:40 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-12.rdu2.redhat.com [10.10.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D45FFDEECF; Wed, 9 May 2018 12:09:33 +0000 (UTC) Date: Wed, 9 May 2018 08:09:17 -0400 From: Richard Guy Briggs To: "Tobin C. Harding" 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: <20180509120917.xz3ggtloq523wqzh@madcap2.tricolour.ca> References: <2f0566af8ccafdaf400a3d002cb4aef9b80e44cf.1525466167.git.rgb@redhat.com> <20180509020700.GE7517@eros> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180509020700.GE7517@eros> User-Agent: NeoMutt/20171027 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 09 May 2018 12:09:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 09 May 2018 12:09:40 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'rgb@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-05-09 12:07, Tobin C. Harding wrote: > 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? Agreed, that is unnecessary, but harmless since it won't be called, or will be called with a value of NULL. That has been fixed in my dynamic allocation patchset since not even the audit_task_info struct is available to assign the value. It is now an empty function like the rest. > Tobin. - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635