Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1078882imm; Wed, 6 Jun 2018 10:05:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKfMjMTWFTvBk418kRPqtf5CHBeBv4K60ZQ01LtxrTUNKHy9//Hmus8+H+1SLkdlwwPv+rl X-Received: by 2002:a17:902:680c:: with SMTP id h12-v6mr4120994plk.113.1528304751194; Wed, 06 Jun 2018 10:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528304751; cv=none; d=google.com; s=arc-20160816; b=xTpoUHbW5zLF/C5pQAn5PXRHn9zQD3F9R9mLOBBzhr02i2eOL5ytSqvSfAUBIch/OH iUIRKvnrsrjOtfnlHZHdrGGFiX21RBtcg16tS9oZPtTD4oqurQ/YzSzZWZ0dhN8l7Drk AwdHap/lMFv4wo9fbELhE1unUO57EXSZR7BiC06cGHKSvDZAuV8Wky0yG17HZWALS9nP j4y5SgVH09NQtfw4C7TZWz+910vPp2PYTpLOajuXkm29dPdO0yk4JpsSXxOd0mOOB1mW JD9iVrHeNICGgxsf0rP/qQHVdHW4rXI5gUOetvVG7E8BEOsSzrfgCykk8jdXByENd9OE 2O/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=0p2JCAAh5aFoXDfRuLYR1H1dNrnNHzmQi6G/6jVTI7M=; b=QcDdrXyC/gp84F6G/ZYEsFm5zDkhBxwoKisJbTVfi6Fw2wrmUY+9Bz7yp56L22DmaZ vYRDyEX7uz9OcoAOxv3T22HTBn4x87ndd8mT4IKAUHbXNfK8H38iuZCladMSH4GfGqXu uCmW83RrqN2mBc2xQkP8mnb8h4JEtDQBu3RrcrpiO8SXE2zIsSBiBgUYbL+zNfxNWh2H bz2BxX/CYGlOUEfTab0OVU46d82ZHijj5kzW+4A+k+Qlok98PXQXKsr7Q7LA3LBudqqa 8vc0E9NxqwEccKqEHASl89AS+GGroaU+NSTpT4diszae5PQ2tP8USMG39V6Orae8b2B+ xevg== 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 a18-v6si41309780pgu.59.2018.06.06.10.05.36; Wed, 06 Jun 2018 10:05:51 -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 S933650AbeFFRB0 (ORCPT + 99 others); Wed, 6 Jun 2018 13:01:26 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:47512 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933630AbeFFRBX (ORCPT ); Wed, 6 Jun 2018 13:01:23 -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 CB5C111E2CA; Wed, 6 Jun 2018 17:01:22 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-57.rdu2.redhat.com [10.10.112.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEF8764671; Wed, 6 Jun 2018 17:01:08 +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, Richard Guy Briggs Subject: [RFC PATCH ghak90 (was ghak32) V3 05/10] audit: add containerid support for tty_audit Date: Wed, 6 Jun 2018 12:58:32 -0400 Message-Id: <28ab8ad3c4e5de6f61b928eeb2af030b04a8820b.1528304204.git.rgb@redhat.com> 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]); Wed, 06 Jun 2018 17:01:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 06 Jun 2018 17:01:22 +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 audit container identifier 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..66bd850 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_contid(context, "tty", audit_get_contid(tsk)); + audit_free_context(context); } /** -- 1.8.3.1