All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Paul Moore <paul@paul-moore.com>
Cc: "Eric Paris" <eparis@redhat.com>,
	"James Morris" <jmorris@namei.org>,
	"Serge E . Hallyn" <serge@hallyn.com>,
	"Ben Scarlato" <akhna@google.com>,
	"Günther Noack" <gnoack@google.com>,
	"Jeff Xu" <jeffxu@google.com>,
	"Jorge Lucangeli Obes" <jorgelo@google.com>,
	"Konstantin Meskhidze" <konstantin.meskhidze@huawei.com>,
	"Shervin Oloumi" <enlightened@google.com>,
	audit@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: Re: [RFC PATCH v1 4/7] landlock: Log domain creation and enforcement
Date: Thu, 21 Dec 2023 19:45:58 +0100	[thread overview]
Message-ID: <20231221.doe8Aebae8vi@digikod.net> (raw)
In-Reply-To: <CAHC9VhQ3fqq6bP=eco1hk=AoMa=5QNyXHCzNw5RZt92y9Z7T2g@mail.gmail.com>

On Wed, Dec 20, 2023 at 04:22:22PM -0500, Paul Moore wrote:
> On Thu, Sep 21, 2023 at 2:17 AM Mickaël Salaün <mic@digikod.net> wrote:
> >
> > Add audit support for domain creation, i.e. task self-restriction.
> >
> > Signed-off-by: Mickaël Salaün <mic@digikod.net>
> > ---
> >  security/landlock/audit.c    | 24 ++++++++++++++++++++++++
> >  security/landlock/audit.h    |  8 ++++++++
> >  security/landlock/syscalls.c |  4 ++++
> >  3 files changed, 36 insertions(+)
> >
> > diff --git a/security/landlock/audit.c b/security/landlock/audit.c
> > index f58bd529784a..d9589d07e126 100644
> > --- a/security/landlock/audit.c
> > +++ b/security/landlock/audit.c
> > @@ -84,6 +84,30 @@ void landlock_log_create_ruleset(struct landlock_ruleset *const ruleset)
> >         audit_log_end(ab);
> >  }
> >
> > +void landlock_log_restrict_self(struct landlock_ruleset *const domain,
> > +                               struct landlock_ruleset *const ruleset)
> > +{
> > +       struct audit_buffer *ab;
> > +
> > +       WARN_ON_ONCE(domain->id);
> > +       WARN_ON_ONCE(!ruleset->id);
> > +
> > +       ab = audit_log_start(audit_context(), GFP_ATOMIC, AUDIT_LANDLOCK);
> > +       if (!ab)
> > +               /* audit_log_lost() call */
> > +               return;
> > +
> > +       domain->hierarchy->id =
> > +               atomic64_inc_return(&ruleset_and_domain_counter);
> > +       log_task(ab);
> > +       audit_log_format(ab, " op=restrict-self domain=%llu ruleset=%llu",
> > +                        domain->hierarchy->id, ruleset->id);
> 
> If domain creation and self restriction are the same, I would suggest
> going with "op=create-domain" so it better matches "op=release-domain"
> in patch 3/7.

OK, I'll do something more consistent.

> 
> Also see my previous comment about consistency between AUDIT_LANDLOCK records.
> 
> > +       audit_log_format(
> > +               ab, " parent=%llu",
> > +               domain->hierarchy->parent ? domain->hierarchy->parent->id : 0);
> > +       audit_log_end(ab);
> > +}
> 
> --
> paul-moore.com
> 

  reply	other threads:[~2023-12-21 18:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21  6:16 [RFC PATCH v1 0/7] Landlock audit support Mickaël Salaün
2023-09-21  6:16 ` [RFC PATCH v1 1/7] lsm: Add audit_log_lsm_data() helper Mickaël Salaün
2023-09-22 23:36   ` kernel test robot
2023-09-23 19:36   ` kernel test robot
2023-12-20 21:22   ` Paul Moore
2023-09-21  6:16 ` [RFC PATCH v1 2/7] landlock: Factor out check_access_path() Mickaël Salaün
2023-09-21  6:16 ` [RFC PATCH v1 3/7] landlock: Log ruleset creation and release Mickaël Salaün
2023-12-20 21:22   ` Paul Moore
2023-12-21 18:45     ` Mickaël Salaün
2023-12-22 22:42       ` Paul Moore
2023-12-29 17:42         ` Mickaël Salaün
2024-01-05 18:12           ` Mickaël Salaün
2024-01-05 22:13           ` Paul Moore
2023-09-21  6:16 ` [RFC PATCH v1 4/7] landlock: Log domain creation and enforcement Mickaël Salaün
2023-12-20 21:22   ` Paul Moore
2023-12-21 18:45     ` Mickaël Salaün [this message]
2023-09-21  6:16 ` [RFC PATCH v1 5/7] landlock: Log file-related requests Mickaël Salaün
2023-09-26  1:26   ` Jeff Xu
2023-09-26 13:35     ` Mickaël Salaün
2023-09-26 21:19       ` Jeff Xu
2023-09-28 15:16         ` Mickaël Salaün
2023-09-28 20:04           ` Jeff Xu
2023-09-29 16:04             ` Mickaël Salaün
2023-09-29 16:33               ` Jeff Xu
2023-12-20 21:22   ` Paul Moore
2023-12-21 18:47     ` Mickaël Salaün
2023-09-21  6:16 ` [RFC PATCH v1 6/7] landlock: Log mount-related requests Mickaël Salaün
2023-09-21  6:16 ` [RFC PATCH v1 7/7] landlock: Log ptrace requests Mickaël Salaün
2023-09-26  1:24 ` [RFC PATCH v1 0/7] Landlock audit support Jeff Xu
2023-09-26 16:24 ` Günther Noack
2023-09-29 16:03   ` Mickaël Salaün
2023-09-28 15:27 ` Mickaël Salaün

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231221.doe8Aebae8vi@digikod.net \
    --to=mic@digikod.net \
    --cc=akhna@google.com \
    --cc=audit@vger.kernel.org \
    --cc=enlightened@google.com \
    --cc=eparis@redhat.com \
    --cc=gnoack@google.com \
    --cc=jeffxu@google.com \
    --cc=jmorris@namei.org \
    --cc=jorgelo@google.com \
    --cc=konstantin.meskhidze@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.