Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp946927ybt; Wed, 8 Jul 2020 16:09:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxblA6QgsGKXkgMKikcn9F1gLrLLWXZVJdt2Ub7u7fMHDwb2uiAHkAi+wjziwX+3lGIcHnQ X-Received: by 2002:a05:6402:3d0:: with SMTP id t16mr67567794edw.287.1594249751442; Wed, 08 Jul 2020 16:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594249751; cv=none; d=google.com; s=arc-20160816; b=CqkLRqASr0/ROsJU+SSwksVYRn9MPEcgsKQG8tCD01jcWY7bbJyZnzXRwioZVmo6LJ FTm73iouaz36TXZv5/EKgTC0Y9Z0QnIN//jipwpnByZ44xaXf5npmgo9JldIVmLCVrPR u7fQ7no6vpl0dHhFdXvmVkGR2hrYh0OtYHlwHkIkL3aEtn6fMO3pWhjJru1IBJi51ejo SQfZ9jXqw33dVwC0cw+ozyU0b3FI285BWU0cgdSGwAJaP4VXiAXd0BYCRu7Dc7JbRinZ rTVABolFADACMyESxEYEbgS2IrleKYnRPVUcOsUbIMgtQxEU3fNXhcimDC2iN3P1kw8V dvqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=2jApHR8WZLOFE/3qde/qPD8ZtCUTqk+p5HMCDcm4XcE=; b=plIZeZzNWZ2NxCDX+uRKzwbhJc4wcqOFoOHl2/Knmrzp9xHxtlptog3ImB7n0gXAv5 3iW78jmJNrwaOhtCHdXOUsnNV3xi6N5r5n9+b5nhPF8zA/JsE8KgiAKHN+2Cejo01j50 fKquAZgoaZwhh+HpRFl2MhwZDiZdV9rRLRZxkFiEsuTSF4tvj9OaHXAxgbJHt+z6PYhm U+SGyj3aLmKAW4+8PUvEmTbBXHd/sAYTbJ42g07gF5MIDWrNPmOHkoLwcCxYjmpwpHd5 YI0E9LOa73x8VET3NSJfDSsTuBgumSpeFkECAbaW7Im0UFY8GCGH6Fv6xJN28E+Z1MZ5 6gFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b="q+Qn5/TO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si739160ejc.99.2020.07.08.16.08.48; Wed, 08 Jul 2020 16:09:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b="q+Qn5/TO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726215AbgGHXGb (ORCPT + 99 others); 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-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