Received: by 10.223.185.116 with SMTP id b49csp7826167wrg; Thu, 1 Mar 2018 11:48:33 -0800 (PST) X-Google-Smtp-Source: AG47ELskI4ZIV7mPYvmbtI96d2TxySHezMU8OmApcm5AtUuoi294bdd3rPh8eaz3RKiE732IfBMs X-Received: by 2002:a17:902:8285:: with SMTP id y5-v6mr2965297pln.190.1519933713607; Thu, 01 Mar 2018 11:48:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519933713; cv=none; d=google.com; s=arc-20160816; b=XhDsU5XJnwMngcsujwlfIDWukscthzyqYxoAeWXrZRZhz3427mnwQhGpFWlxTdOWMT JGTHKL9K5UPmL0yhKZHksqQ5p87xbuzhJOvuOecEge4ikxyRhK3bN7cjeFJvUqvxZpAE qSMrx+k/eoAF+B/ZqM/7gSLLulKT7pKfvsT0CFXC4lsswoppB6JcQn2wzdBgz5hV26PF t7FaqOGxwJyeUsu8GvNusjiq3w0PTZjbNhH42rqtPBYHh1qIzygwAOoApfE/PtqHJU8t oNPlfRKLhc7ZvfxQZ0AyJqcAFI5WzzdO3Wl0mv/bELhWdI7keWkw5JVlwcXkvjzDm97z tU8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yjdkekBPEp9WUBKOQlCpRYBIBTMb0MMbvFRsBZSSiHg=; b=Rj2hBaw3OniU2Bv+gekba96L8R8A90jaBqorouvBYlMsCYRBbehQDhZaaEerEnleNp 1Nw+Wmoh1z8xMCTfl0vEoDj54PFQh3oIIUyv+2R30rIbjxRtaF5kDvp/hEU3LoKPTvtn agGqBzX50QfL0rfscvIjzNf+dE5kIgMYxObiZEL4SpRmGzYPQCxomdv0gHZnMDMw/4cJ FUXbz77jO6MFkhncH5pFLBvxYHa810Vkw9BRCw2bbr+5MRWf/T4DmRzz2cCMkCrrYuZ6 2TmCBi42fmxT3kOFEszBE64B3YHWuoSZ+iWXpzYg0IiBZ5pn0PcPzWOAlW++8AdFQVjz R2TA== 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 n12si3460431pfj.207.2018.03.01.11.48.19; Thu, 01 Mar 2018 11:48:33 -0800 (PST) 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 S1034208AbeCATrX (ORCPT + 99 others); Thu, 1 Mar 2018 14:47:23 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48786 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1033812AbeCATrR (ORCPT ); Thu, 1 Mar 2018 14:47:17 -0500 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 8C44CEAEBF; Thu, 1 Mar 2018 19:47:16 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-12.rdu2.redhat.com [10.10.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EE3B9C076; Thu, 1 Mar 2018 19:47:13 +0000 (UTC) From: Richard Guy Briggs To: cgroups@vger.kernel.org, containers@lists.linux-foundation.org, linux-api@vger.kernel.org, Linux-Audit Mailing List , linux-fsdevel@vger.kernel.org, LKML , netdev@vger.kernel.org Cc: mszeredi@redhat.com, luto@kernel.org, jlayton@redhat.com, carlos@redhat.com, viro@zeniv.linux.org.uk, dhowells@redhat.com, simo@redhat.com, trondmy@primarydata.com, eparis@parisplace.org, serge@hallyn.com, ebiederm@xmission.com, madzcar@gmail.com, Richard Guy Briggs Subject: [RFC PATCH V1 10/12] audit: add containerid support for seccomp and anom_abend records Date: Thu, 1 Mar 2018 14:41:13 -0500 Message-Id: In-Reply-To: References: In-Reply-To: References: 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]); Thu, 01 Mar 2018 19:47:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 01 Mar 2018 19:47:16 +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 Add container ID information to secure computing and abnormal end standalone records. Signed-off-by: Richard Guy Briggs --- kernel/auditsc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 0cbd762..fcee34e 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -2569,6 +2569,7 @@ static void audit_log_task(struct audit_buffer *ab) void audit_core_dumps(long signr) { struct audit_buffer *ab; + struct audit_context *context = audit_alloc_local(); if (!audit_enabled) return; @@ -2576,19 +2577,22 @@ void audit_core_dumps(long signr) if (signr == SIGQUIT) /* don't care for those */ return; - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_ANOM_ABEND); + ab = audit_log_start(context, GFP_KERNEL, AUDIT_ANOM_ABEND); if (unlikely(!ab)) return; audit_log_task(ab); audit_log_format(ab, " sig=%ld res=1", signr); audit_log_end(ab); + audit_log_container_info(context, "abend", audit_get_containerid(current)); + audit_free_context(context); } void __audit_seccomp(unsigned long syscall, long signr, int code) { struct audit_buffer *ab; + struct audit_context *context = audit_alloc_local(); - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_SECCOMP); + ab = audit_log_start(context, GFP_KERNEL, AUDIT_SECCOMP); if (unlikely(!ab)) return; audit_log_task(ab); @@ -2596,6 +2600,8 @@ void __audit_seccomp(unsigned long syscall, long signr, int code) signr, syscall_get_arch(), syscall, in_compat_syscall(), KSTK_EIP(current), code); audit_log_end(ab); + audit_log_container_info(context, "seccomp", audit_get_containerid(current)); + audit_free_context(context); } struct list_head *audit_killed_trees(void) -- 1.8.3.1