From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Grubb Subject: Re: [ARCHIVE DEBUG 06/13] audit_debug: don't let systemd change config Date: Thu, 22 Oct 2015 15:18:19 -0400 Message-ID: <2054929.FHXHZSGzHO@x2> References: <9307bb8cd95c66773be32c2bff4d1be3efd94d10.1445536765.git.rgb@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <9307bb8cd95c66773be32c2bff4d1be3efd94d10.1445536765.git.rgb@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Richard Guy Briggs Cc: linux-audit@redhat.com List-Id: linux-audit@redhat.com On Thursday, October 22, 2015 02:58:52 PM Richard Guy Briggs wrote: > Debug the possibility of systemd changing the audit config causing > shutdown delays by blocking all such requests. I don't understand what you are saying here. As long as something something has CAP_AUDIT_CONTROL, it can make changes. But we have to record what made the changes in the logs. -Steve > Signed-off-by: Richard Guy Briggs > --- > kernel/audit.c | 14 ++++++++------ > 1 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/kernel/audit.c b/kernel/audit.c > index 30b3b08..93a466b 100644 > --- a/kernel/audit.c > +++ b/kernel/audit.c > @@ -680,18 +680,20 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 > msg_type) case AUDIT_ADD: > case AUDIT_DEL: > return -EOPNOTSUPP; > - case AUDIT_GET: > case AUDIT_SET: > - case AUDIT_GET_FEATURE: > case AUDIT_SET_FEATURE: > - case AUDIT_LIST_RULES: > case AUDIT_ADD_RULE: > case AUDIT_DEL_RULE: > - case AUDIT_SIGNAL_INFO: > - case AUDIT_TTY_GET: > - case AUDIT_TTY_SET: > case AUDIT_TRIM: > case AUDIT_MAKE_EQUIV: > + case AUDIT_TTY_SET: > + if (current->tgid == 1) > + return -EPERM; > + case AUDIT_GET: > + case AUDIT_GET_FEATURE: > + case AUDIT_LIST_RULES: > + case AUDIT_SIGNAL_INFO: > + case AUDIT_TTY_GET: > /* Only support auditd and auditctl in initial pid namespace > * for now. */ > if ((task_active_pid_ns(current) != &init_pid_ns))