Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp30494imm; Tue, 31 Jul 2018 13:13:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgperSj/sOKkT7kBPUtgd6FCcmp0zVzMo1J405TjizAvuNgkfDdszdkTNH8fKR1aaXbwhrYAC X-Received: by 2002:a17:902:209:: with SMTP id 9-v6mr21975805plc.270.1533068001400; Tue, 31 Jul 2018 13:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533068001; cv=none; d=google.com; s=arc-20160816; b=BZ7OCWVN6Q/h9g+OcEJA/wgL+QFtAra2nawRtokc3uadNV/tbySqwg0ww/zOZIoWfx 7nduRjA9KGxbMYC+5WCYloqHoB+nXRa3CYa1QJXSOwI/46fOK5fYW0uJHueQ4IyHV4Q/ u3gTcpXxyearRBUUXEcNAMMdBQOB0Ih8pBLkunfXkOxZMBD/ysu7oiYEA7OVxJfi9iwE DX1wy5l48Xmd2eaJ2EYDoXytzIU12niOWx4sllXMsgfLIU+xdmBwrWtrZEkmDpIf6Vqe x+sz1YmKI4IRaQokEStRPTjtt1reVfRIqlfsDKLl0NIFx+lfcRDrCBCYRDZujNdHcpYO sQIg== 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=MXIKS9eciViC2A8eNPv4dlGIRTuQtuXtDDxrZtCGNiI=; b=i2+OrdkUu0bmegvcIrWXYG+5cIboSwVqKqPEOj0qitSTORfP/F9d/qWZ/+tDh7b2hY SMirKQ2pcmtroKRLDdT2QyTAmLo0b47HivRdTLa4YXi/j7Njf+2A583e04Xou8dY/Fzx YAQDiLdbn8vpEL0EJg5VSNCtKDeLm7DZ0mvCzdU1qQ9g6BVWq+JeB8Cmi0zfAvg3sfk1 hABhROP7x86tDtGgiM8xpS4S9nfwrgmJBNbQOilhQQxxlcQwiPnovCfJ9euXVKiE6ukU DYPFQg4axkVWzsTw7QfhI+q3pBi+mPnji8fe8/0HhxRznlWXBdnF2xbEbE22Kt5dN2si WJHA== 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 o15-v6si14508023pgq.236.2018.07.31.13.13.01; Tue, 31 Jul 2018 13:13:21 -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 S1732694AbeGaVxk (ORCPT + 99 others); Tue, 31 Jul 2018 17:53:40 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58840 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732659AbeGaVxi (ORCPT ); Tue, 31 Jul 2018 17:53:38 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AA8B04001388; Tue, 31 Jul 2018 20:11:39 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-17.rdu2.redhat.com [10.10.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9D302026D7E; Tue, 31 Jul 2018 20:11:36 +0000 (UTC) From: Richard Guy Briggs To: containers@lists.linux-foundation.org, linux-api@vger.kernel.org, Linux-Audit Mailing List , linux-fsdevel@vger.kernel.org, LKML , netdev@vger.kernel.org, netfilter-devel@vger.kernel.org Cc: luto@kernel.org, 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: [PATCH ghak90 (was ghak32) V4 06/10] audit: add containerid support for tty_audit Date: Tue, 31 Jul 2018 16:07:41 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 31 Jul 2018 20:11:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 31 Jul 2018 20:11:39 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.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 Acked-by: Serge Hallyn --- 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 50f567b..3e21477 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(GFP_KERNEL); - 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