Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp736075yba; Thu, 18 Apr 2019 08:43:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzeZChVS1oxe5PUmgMjZVKKmhRW8LuGJCpUxiJGitvFBt9tiCndYFK15nuRnUWZ407HAPsS X-Received: by 2002:a63:af0a:: with SMTP id w10mr64121587pge.67.1555602223454; Thu, 18 Apr 2019 08:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555602223; cv=none; d=google.com; s=arc-20160816; b=v86agx9AchnJlrseIOxYNXEo63zLet087TkG/xDZYQTkAPpkBts86VmdQTtt0WoXAh 641Ee/hqKYiF8xuWaY3re2ePvjCBHJXGpMSVykeH5YWVBg44G9VphTimWDxnxCZ3sJbn 7JOyYSuAJmjmGvFkkBp78lpIL2e9cE0fDoDr5t7daHxBXnTer1DpgCxlAnb9qjC5NT5k xx4WF/6Nk/JQ2a/vLWaAYCC2X/tJsXIztfsfOfyqzF9dDg/WkDYgtekR+Yifo3Xf0o+i eROsPoN6w3wwF8ZwcLxMNoK2iLAZcUrcbwW2O3GwAFvus7e8dT1f4wt80KqmSsxjjmRL 2xOQ== 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; bh=I8lqw9O0jL3I0XXHdeG02lyOF56DAbIIB0l29T3EL68=; b=HBPeaaYWLVR3H5fkTLIK17EppQ0vdgl6LX9GbOacT4i3UDqqeDugx0WscyCPsm6i98 aJce8lCVBgMIwQ3fuhCVRa7kSK1AUa9nURpayYI10XeIrhqzOE4IlUxnGmxsHidx00+q 9UkVgAuy2cKdFp8uDIcKceYmTd1uzd6AsDmEq5CY+I8U4cYcyEoFgfJWw8w+4eAKO9A5 5wPEuN6PDBHWLBsROAgafHrbRREQeLTIsrnwKIiYgEX2dkyAc77oZmL4J8NNguu0VofU A0fRT+RHNObJ/RzeCruSVD8JCs7CQASqGzgyRc49jl46NprJJM/s5hcolhKmpJFXdST9 IdQQ== 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 v47si2142883pgn.117.2019.04.18.08.43.28; Thu, 18 Apr 2019 08:43:43 -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 S2389133AbfDRPmW (ORCPT + 99 others); Thu, 18 Apr 2019 11:42:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59734 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387519AbfDRPmV (ORCPT ); Thu, 18 Apr 2019 11:42:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32069C059B9F; Thu, 18 Apr 2019 15:42:21 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-16.phx2.redhat.com [10.3.112.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 801FE60BE5; Thu, 18 Apr 2019 15:42:09 +0000 (UTC) Date: Thu, 18 Apr 2019 11:42:06 -0400 From: Richard Guy Briggs To: Paul Moore Cc: LKML , Linux-Audit Mailing List , sgrubb@redhat.com, omosnace@redhat.com, Eric Paris , ebiederm@xmission.com, oleg@redhat.com Subject: Re: [PATCH ghak111 V1] audit: deliver siginfo regarless of syscall Message-ID: <20190418154206.itjcwd5mjxwfvwe5@madcap2.tricolour.ca> References: <20190418151642.nb5mgrxfw55hqecs@madcap2.tricolour.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 18 Apr 2019 15:42:21 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-04-18 11:37, Paul Moore wrote: > On Thu, Apr 18, 2019 at 11:16 AM Richard Guy Briggs wrote: > > On 2019-04-18 10:59, Paul Moore wrote: > > > On Mon, Apr 8, 2019 at 11:53 PM Richard Guy Briggs wrote: > > > > When a process signals the audit daemon (shutdown, rotate, resume, > > > > reconfig) but syscall auditing is not enabled, we still want to know the > > > > identity of the process sending the signal to the audit daemon. > > > > > > > > Move audit_signal_info() out of syscall auditing to general auditing but > > > > create a new function audit_signal_info_syscall() to take care of the > > > > syscall dependent parts for when syscall auditing is enabled. > > > > > > > > Please see the github kernel audit issue > > > > https://github.com/linux-audit/audit-kernel/issues/111 > > > > > > > > Signed-off-by: Richard Guy Briggs > > > > --- > > > > include/linux/audit.h | 6 ++++++ > > > > kernel/audit.c | 27 +++++++++++++++++++++++++++ > > > > kernel/audit.h | 4 ++-- > > > > kernel/auditsc.c | 19 +++---------------- > > > > kernel/signal.c | 2 +- > > > > 5 files changed, 39 insertions(+), 19 deletions(-) > > > > > > ... > > > > > > > diff --git a/include/linux/audit.h b/include/linux/audit.h > > > > index 1e69d9fe16da..4a22fc3f824f 100644 > > > > --- a/include/linux/audit.h > > > > +++ b/include/linux/audit.h > > > > @@ -226,6 +229,9 @@ static inline unsigned int audit_get_sessionid(struct task_struct *tsk) > > > > } > > > > > > > > #define audit_enabled AUDIT_OFF > > > > + > > > > +#define audit_signal_info(s, t) AUDIT_OFF > > > > + > > > > > > Should this be AUDIT_DISABLED to preserve the current value/behavior? > > > Technically they should both have a value of zero right now, but since > > > the AUDIT_DISABLED value isn't explicit it seems safer to go with > > > AUDIT_DISABLED. > > > > I did that first, but that symbol was not available when one or both of > > CONFIG_AUDITSYSCALL or CONFIG_AUDIT was off, so I had to change it to > > AUDIT_OFF. I followed the logic to confirm that is what was intended by > > the original code. > > > > When auidit is off, we want to just return zero so it gets skipped > > rather than throwing an error. > > I understand the desire to return zero in that case, I'm not arguing > against that, I'm just not really in love with how these are defined > when CONFIG_AUDIT isn't. Part of it is the AUDIT_DISABLED/AUDIT_OFF > change, part of it is the function being defined as a cpp macro > instead of a dummy function (this of course predates your change). > Based on other comments in this thread it looks like you're looking > into a few things and will likely be respinning this patch, since that > is the case, I would prefer if you changed this to just using simply > "0" as opposed to AUDIT_OFF. > > If you really want to make me happy about this patch, you would also > change this to a dummy function instead of a cpp macro. This is a > style nit, and isn't strictly necessary, but I would appreciate it :) In fact, I'd started with a dummy function, then changed it to match the style of the rest of the file when I got a pile of unused function complaints from all over the kernel... I'll see what I can do to go back to the dummy function. > > > > diff --git a/kernel/audit.h b/kernel/audit.h > > > > index 958d5b8fc1b3..18a8ae812e9f 100644 > > > > --- a/kernel/audit.h > > > > +++ b/kernel/audit.h > > > > @@ -299,7 +299,7 @@ extern bool audit_tree_match(struct audit_chunk *chunk, > > > > extern void audit_put_tree(struct audit_tree *tree); > > > > extern void audit_kill_trees(struct audit_context *context); > > > > > > > > -extern int audit_signal_info(int sig, struct task_struct *t); > > > > +extern int audit_signal_info_syscall(struct task_struct *t); > > > > extern void audit_filter_inodes(struct task_struct *tsk, > > > > struct audit_context *ctx); > > > > extern struct list_head *audit_killed_trees(void); > > > > @@ -330,7 +330,7 @@ extern void audit_filter_inodes(struct task_struct *tsk, > > > > #define audit_tree_path(rule) "" /* never called */ > > > > #define audit_kill_trees(context) BUG() > > > > > > > > -#define audit_signal_info(s, t) AUDIT_DISABLED > > > > +#define audit_signal_info_syscall(t) AUDIT_OFF > > > > > > Similar as above. > > -- > paul moore > www.paul-moore.com - 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