Received: by 10.213.65.68 with SMTP id h4csp261231imn; Fri, 16 Mar 2018 02:11:06 -0700 (PDT) X-Google-Smtp-Source: AG47ELvFpsP83bt5rCUpsHndpLIwsm76tai/rYPyhUHd0VEuaHtsQ3DxOzAzq7D5t10HMrTxgXe2 X-Received: by 10.98.61.73 with SMTP id k70mr971320pfa.10.1521191465971; Fri, 16 Mar 2018 02:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521191465; cv=none; d=google.com; s=arc-20160816; b=bkJ0GZbn+XeJ1Omj1xcmRqyVc2j72ugPhJPcUhuugaLq9GrdVEdOHGrOGKg6IDNvcC sF19u6iT5U+j1p68kmFYtDeI5ntO2oXxIqWvUiNjxLTe4tD6HKIf8osFVA1EbJb44l41 xY/uTNUzaC66gXT68bgNhgFea+ZrKSsvmu+Bx/gTwTZdH/fUbHSKxsWIPxy1BfTKOe7d iRW6fW9ishsPnd8Fm79bgJcJqZkL8cB3Z7/b1N3SySdoeNgi676tRRmoXeuPREI3+eaC 7VgyhCLwc7yH4yrrzgFBuTkKm/z0k9Y9BIeodlCZNVXYm5JsLEKPi04gPHweX8lh/nd6 wy/A== 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=xz8I5YQI2m0bp4WrJs6/HJHqovcH4UFaFM0MrEbIMvQ=; b=wJSXjpcagewoKb3a3uEmyNlxS1UZMFvMH5bSTl2LvefMxbhR7godQm7JHYZ73jehks BJy8u5wd94d2gUvDnt0YbinybbHHs9WnbviLBXr9O5KzOF9SJ1ldrqE8J7jTVkazSUL1 zmOzTrNiPUiUZliRzYGlIIY+vLxjU8rb+aO82bGtlnlqIg8/tsx8b1PvtGcjQdmQ7ty9 +WwvT4IBCeC1XDAQS+TABPVpY9AhS+NCVdFqT2MnJ1/mkjFsdb41VAmT7NrUQ10/7dLl 8XLywp7CR5NEDWESRnxXtphVTVBHqwst2+BM0txJZ9goTMEn2OTR03ZNS2UaWegERNwX DMXg== 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 h10si4762851pgf.33.2018.03.16.02.10.51; Fri, 16 Mar 2018 02:11:05 -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 S1753476AbeCPJHO (ORCPT + 99 others); Fri, 16 Mar 2018 05:07:14 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49682 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753399AbeCPJGx (ORCPT ); Fri, 16 Mar 2018 05:06:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A1F420CC6; Fri, 16 Mar 2018 09:06:52 +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 0FC0910B009F; Fri, 16 Mar 2018 09:06:48 +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: luto@kernel.org, jlayton@redhat.com, carlos@redhat.com, viro@zeniv.linux.org.uk, dhowells@redhat.com, simo@redhat.com, eparis@parisplace.org, serge@hallyn.com, ebiederm@xmission.com, madzcar@gmail.com, Richard Guy Briggs Subject: [RFC PATCH ghak32 V2 08/13] audit: add containerid support for tty_audit Date: Fri, 16 Mar 2018 05:00:35 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 16 Mar 2018 09:06:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 16 Mar 2018 09:06:52 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 auxiliary record to tty logging rule event standalone records. Signed-off-by: Richard Guy Briggs --- drivers/tty/tty_audit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c index e30aa6b..48ee4b7 100644 --- a/drivers/tty/tty_audit.c +++ b/drivers/tty/tty_audit.c @@ -66,8 +66,9 @@ static void tty_audit_log(const char *description, dev_t dev, uid_t uid = from_kuid(&init_user_ns, task_uid(tsk)); uid_t loginuid = from_kuid(&init_user_ns, audit_get_loginuid(tsk)); unsigned int sessionid = audit_get_sessionid(tsk); + struct audit_context *context = audit_alloc_local(); - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_TTY); + ab = audit_log_start(context, GFP_KERNEL, AUDIT_TTY); if (ab) { char name[sizeof(tsk->comm)]; @@ -80,6 +81,8 @@ static void tty_audit_log(const char *description, dev_t dev, audit_log_n_hex(ab, data, size); audit_log_end(ab); } + audit_log_container_info(context, "tty", audit_get_containerid(tsk)); + audit_free_context(context); } /** -- 1.8.3.1