From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A21FC433DF for ; Wed, 8 Jul 2020 23:06:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 002A420775 for ; Wed, 8 Jul 2020 23:06:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore-com.20150623.gappssmtp.com header.i=@paul-moore-com.20150623.gappssmtp.com header.b="q+Qn5/TO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726275AbgGHXGb (ORCPT ); Wed, 8 Jul 2020 19:06:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgGHXGa (ORCPT ); Wed, 8 Jul 2020 19:06:30 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F7A8C061A0B for ; Wed, 8 Jul 2020 16:06:30 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id lx13so226344ejb.4 for ; Wed, 08 Jul 2020 16:06:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2jApHR8WZLOFE/3qde/qPD8ZtCUTqk+p5HMCDcm4XcE=; b=q+Qn5/TO5qyj1SaFlPI7928PUOSkBfuzrAV+iYm14zPwybCFy3PMOcolKsCPzShBd4 pEs9F0B1JDt/lqiFdctP7GUOMvrKAhDSyEePNbSH+2B9VUeTiSPWwU5sGak2AtFFqUBY m71JTIDwWnSJeTGeLgl8AHhD8Vjbx7yDhfn3OwNPc+vvRdJHHvit47FaiLztOVYW7B3z AU2ENBu+1fT04qgSa5oLRjWvc3LHdZQOIVW7u1JJoK6ta2hdRo7vttBZnoA2lWJHXsAd EUPwatFGjpSR6r6lbJvP13kUBeyizOL8nPpcsuN39CEplK5j+IWt08kAjq4Q47J2os3d oDcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2jApHR8WZLOFE/3qde/qPD8ZtCUTqk+p5HMCDcm4XcE=; b=NlhW9O8yz+CGHFvWYINrQ1F/pfNOXUlJdtWfcKg3j4Wr7T87BAHEBE1fK7mAW0WBfI Nezy7YHRQ3ov6c5Up+3PfJY0ZkdoyE4MzOZGfIHmQunvQDvGnXf/u8F9dGm3vEeWWQgX BMur3TV/oEtJ7JzVco2xMnb0jQI69uBZ1sd3Ck6sXmoShJnPN26tzO5YYG0pecb+cY0f fkmOCDmymS8M15xAfc36vD+LxSiimgpQ2ipJ+EVRczGBUhzVmBGXVBoIZabkZ0Bvkw+j 3GVc3xfFChc8I+SOoAKudIE+Ck4wDwfKKw+MOdZKmG48mj7V7ksT9zi0oonw0Mp4ZkWo liFA== X-Gm-Message-State: AOAM533elbVnFzhgdrizeEUDxaVy7PMEmfzjWJrnLjQvp3Vik1mky7KP pL8Qn+G96aZ+w9Dn7MbkaFJEmV5kFzdxhBDu7q1s X-Google-Smtp-Source: ABdhPJxEI74qZhwUWSKk0hFFl180ExVWBpR6pJlwatkcRmWOeQZ+z2OKCc+DEzr4Hd0AhJGNQUM5Ky2Op4P28Eh4efw= X-Received: by 2002:a17:906:456:: with SMTP id e22mr47815401eja.178.1594249589239; Wed, 08 Jul 2020 16:06:29 -0700 (PDT) MIME-Version: 1.0 References: <878ac79163e31142963f1cd4f743599c35b6754a.1593691408.git.rgb@redhat.com> In-Reply-To: <878ac79163e31142963f1cd4f743599c35b6754a.1593691408.git.rgb@redhat.com> From: Paul Moore Date: Wed, 8 Jul 2020 19:06:18 -0400 Message-ID: Subject: Re: [PATCH ghak96 v3] audit: issue CWD record to accompany LSM_AUDIT_DATA_* records To: Richard Guy Briggs Cc: Linux-Audit Mailing List , LKML , Linux Security Module list , Eric Paris , john.johansen@canonical.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 3, 2020 at 12:56 PM Richard Guy Briggs wrote: > > The LSM_AUDIT_DATA_* records for PATH, FILE, IOCTL_OP, DENTRY and INODE > are incomplete without the task context of the AUDIT Current Working > Directory record. Add it. > > This record addition can't use audit_dummy_context to determine whether > or not to store the record information since the LSM_AUDIT_DATA_* > records are initiated by various LSMs independent of any audit rules. > context->in_syscall is used to determine if it was called in user > context like audit_getname. > > Please see the upstream issue > https://github.com/linux-audit/audit-kernel/issues/96 > > Adapted from Vladis Dronov's v2 patch. > > Signed-off-by: Richard Guy Briggs > --- > Passes audit-testsuite. > > Changelog: > v3 > - adapt and refactor__audit_getname, don't key on dummy > > v2 > 2020-04-02 vdronov https://www.redhat.com/archives/linux-audit/2020-April/msg00004.html > - convert to standalone CWD record > > v1: > 2020-03-24 vdronov https://github.com/nefigtut/audit-kernel/commit/df0b55b7ab84e1c9faa588b08e547e604bf25c87 > - add cwd= field to LSM record > > include/linux/audit.h | 9 ++++++++- > kernel/auditsc.c | 17 +++++++++++++++-- > security/lsm_audit.c | 5 +++++ > 3 files changed, 28 insertions(+), 3 deletions(-) Merged into audit/next, thanks. -- paul moore www.paul-moore.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C24A3C433DF for ; Wed, 8 Jul 2020 23:06:45 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6791B20772 for ; Wed, 8 Jul 2020 23:06:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6791B20772 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=paul-moore.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-audit-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-368-lGx1HPkJNACnanNdTRMC6A-1; Wed, 08 Jul 2020 19:06:42 -0400 X-MC-Unique: lGx1HPkJNACnanNdTRMC6A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E6102800C64; Wed, 8 Jul 2020 23:06:38 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4605D10016E8; Wed, 8 Jul 2020 23:06:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C16D793F63; Wed, 8 Jul 2020 23:06:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 068N6ZYT020021 for ; Wed, 8 Jul 2020 19:06:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 213F2111F6; Wed, 8 Jul 2020 23:06:35 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C71F3325B for ; Wed, 8 Jul 2020 23:06:32 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4C1D924906 for ; Wed, 8 Jul 2020 23:06:32 +0000 (UTC) Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-291-Bup-9_R-PViU5xNiFUWDBQ-1; Wed, 08 Jul 2020 19:06:30 -0400 X-MC-Unique: Bup-9_R-PViU5xNiFUWDBQ-1 Received: by mail-ej1-f68.google.com with SMTP id n26so247458ejx.0 for ; Wed, 08 Jul 2020 16:06:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2jApHR8WZLOFE/3qde/qPD8ZtCUTqk+p5HMCDcm4XcE=; b=hQmugevIQS+EB3dCG5Mk54IEOmCnVerjhwH8ZNh5F7kIkxJfiN1nhfqBZ+UbVvigDW 8SzFAxO/RBqZn1p7Io5T5kv4doEMdrp2Z1ZR3VNXPEZLaskf2P5Sqp4f1ihWf/M4oVaX NmIcsZz8UGLNGgm+F1KkVy6Mg2/f7T6rVPsApJX28tTQ4RfknxiJRiW7IxNqqDQM4MQa XIhvT+CEeiUjEWQ4Qr74QRRJIjdal2QUhWYMkaEZGuK2kULRBZiMjbf4ilLCzBEWdACw HwvQIJuY+bRMfaNwIgxxLmZ+/ro33jn7W4RzZTQEs6dfZ0hgYQaaWAKDC2cOUlxQSBtr FMUg== X-Gm-Message-State: AOAM533EL6aZMit29kuFZ+2afzDk0WiUJPOjwJlrIubzPVkuc9J5uVC2 pr0HEb7lIrjmsnC7WtZqXFFBuzNXoTWZbA7Zgsy7 X-Google-Smtp-Source: ABdhPJxEI74qZhwUWSKk0hFFl180ExVWBpR6pJlwatkcRmWOeQZ+z2OKCc+DEzr4Hd0AhJGNQUM5Ky2Op4P28Eh4efw= X-Received: by 2002:a17:906:456:: with SMTP id e22mr47815401eja.178.1594249589239; Wed, 08 Jul 2020 16:06:29 -0700 (PDT) MIME-Version: 1.0 References: <878ac79163e31142963f1cd4f743599c35b6754a.1593691408.git.rgb@redhat.com> In-Reply-To: <878ac79163e31142963f1cd4f743599c35b6754a.1593691408.git.rgb@redhat.com> From: Paul Moore Date: Wed, 8 Jul 2020 19:06:18 -0400 Message-ID: Subject: Re: [PATCH ghak96 v3] audit: issue CWD record to accompany LSM_AUDIT_DATA_* records To: Richard Guy Briggs X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: linux-audit@redhat.com Cc: Eric Paris , Linux Security Module list , Linux-Audit Mailing List , LKML , john.johansen@canonical.com X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Jul 3, 2020 at 12:56 PM Richard Guy Briggs wrote: > > The LSM_AUDIT_DATA_* records for PATH, FILE, IOCTL_OP, DENTRY and INODE > are incomplete without the task context of the AUDIT Current Working > Directory record. Add it. > > This record addition can't use audit_dummy_context to determine whether > or not to store the record information since the LSM_AUDIT_DATA_* > records are initiated by various LSMs independent of any audit rules. > context->in_syscall is used to determine if it was called in user > context like audit_getname. > > Please see the upstream issue > https://github.com/linux-audit/audit-kernel/issues/96 > > Adapted from Vladis Dronov's v2 patch. > > Signed-off-by: Richard Guy Briggs > --- > Passes audit-testsuite. > > Changelog: > v3 > - adapt and refactor__audit_getname, don't key on dummy > > v2 > 2020-04-02 vdronov https://www.redhat.com/archives/linux-audit/2020-April/msg00004.html > - convert to standalone CWD record > > v1: > 2020-03-24 vdronov https://github.com/nefigtut/audit-kernel/commit/df0b55b7ab84e1c9faa588b08e547e604bf25c87 > - add cwd= field to LSM record > > include/linux/audit.h | 9 ++++++++- > kernel/auditsc.c | 17 +++++++++++++++-- > security/lsm_audit.c | 5 +++++ > 3 files changed, 28 insertions(+), 3 deletions(-) Merged into audit/next, thanks. -- paul moore www.paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://www.redhat.com/mailman/listinfo/linux-audit