From: "Mickaël Salaün" <mic@digikod.net>
To: Song Liu <songliubraving@meta.com>
Cc: "Paul Moore" <paul@paul-moore.com>,
"Christian Brauner" <brauner@kernel.org>,
"Song Liu" <song@kernel.org>, bpf <bpf@vger.kernel.org>,
Linux-Fsdevel <linux-fsdevel@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Kernel Team" <kernel-team@meta.com>,
"andrii@kernel.org" <andrii@kernel.org>,
"eddyz87@gmail.com" <eddyz87@gmail.com>,
"ast@kernel.org" <ast@kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"martin.lau@linux.dev" <martin.lau@linux.dev>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
"jack@suse.cz" <jack@suse.cz>,
"kpsingh@kernel.org" <kpsingh@kernel.org>,
"mattbobrowski@google.com" <mattbobrowski@google.com>,
"Liam Wisehart" <liamwisehart@meta.com>,
"Liang Tang" <lltang@meta.com>,
"Shankaran Gnanashanmugam" <shankaran@meta.com>,
"LSM List" <linux-security-module@vger.kernel.org>,
"Günther Noack" <gnoack@google.com>
Subject: Re: [PATCH bpf-next 2/2] selftests/bpf: Add tests for bpf_get_dentry_xattr
Date: Fri, 23 Aug 2024 12:38:36 +0200 [thread overview]
Message-ID: <20240823.zeiC0zauhah1@digikod.net> (raw)
In-Reply-To: <7A37AEE2-7DEA-4CC4-B0DB-6F6326BE6596@fb.com>
On Wed, Aug 21, 2024 at 03:43:48AM +0000, Song Liu wrote:
>
>
> > On Aug 20, 2024, at 2:11 PM, Paul Moore <paul@paul-moore.com> wrote:
> >
> > On Tue, Aug 20, 2024 at 1:43 PM Song Liu <songliubraving@meta.com> wrote:
> >>> On Aug 20, 2024, at 5:45 AM, Mickaël Salaün <mic@digikod.net> wrote:
> >
> > ...
> >
> >>> What about adding BPF hooks to Landlock? User space could create
> >>> Landlock sandboxes that would delegate the denials to a BPF program,
> >>> which could then also allow such access, but without directly handling
> >>> nor reimplementing filesystem path walks. The Landlock user space ABI
> >>> changes would mainly be a new landlock_ruleset_attr field to explicitly
> >>> ask for a (system-wide) BPF program to handle access requests if no
> >>> Landlock rule allow them. We could also tie a BPF data (i.e. blob) to
> >>> Landlock domains for consistent sandbox management. One of the
> >>> advantage of this approach is to only run related BPF programs if the
> >>> sandbox policy would deny the request. Another advantage would be to
> >>> leverage the Landlock user space interface to let any program partially
> >>> define and extend their security policy.
> >>
> >> Given there is BPF LSM, I have never thought about adding BPF hooks to
> >> Landlock or other LSMs. I personally would prefer to have a common API
> >> to walk the path, maybe something like vma_iterator. But I need to read
> >> more code to understand whether this makes sense?
I think it would not be an issue to use BPF Landlock hooks along with
BPF LSM hooks for the same global policy. This could also use the
Landlock domain concept for your use case, including domain inheritance,
domain identification, cross-domain protections... to avoid
reimplementing the same semantic (and going through the same issues).
Limiting the BPF program calls could also improve performance.
> >
> > Just so there isn't any confusion, I want to make sure that everyone
> > is clear that "adding BPF hooks to Landlock" should mean "add a new
> > Landlock specific BPF hook inside Landlock" and not "reuse existing
> > BPF LSM hooks inside Landlock".
>
> I think we are on the same page. My understanding of Mickaël's idea is
> to add some brand new hooks to Landlock code, so that Landlock can
> use BPF program to make some decisions.
Correct
next prev parent reply other threads:[~2024-08-23 10:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-25 23:47 [PATCH bpf-next 0/2] Add kfuncs to support reading xattr from dentry Song Liu
2024-07-25 23:47 ` [PATCH bpf-next 1/2] bpf: Add kfunc bpf_get_dentry_xattr() to read " Song Liu
2024-07-26 5:34 ` Al Viro
2024-07-26 7:01 ` Song Liu
2024-07-25 23:47 ` [PATCH bpf-next 2/2] selftests/bpf: Add tests for bpf_get_dentry_xattr Song Liu
2024-07-26 7:06 ` Christian Brauner
2024-07-26 9:19 ` Song Liu
2024-07-26 11:51 ` Christian Brauner
2024-07-26 19:43 ` Song Liu
2024-07-29 13:46 ` Christian Brauner
2024-07-30 5:58 ` Song Liu
2024-07-30 8:59 ` Christian Brauner
2024-08-19 7:18 ` Song Liu
2024-08-19 11:16 ` Christian Brauner
2024-08-19 13:12 ` Mickaël Salaün
2024-08-19 20:35 ` Song Liu
2024-08-20 12:45 ` Mickaël Salaün
2024-08-20 17:42 ` Song Liu
2024-08-20 21:11 ` Paul Moore
2024-08-21 3:43 ` Song Liu
2024-08-23 10:38 ` Mickaël Salaün [this message]
2024-08-19 20:25 ` Song Liu
2024-08-20 5:42 ` Song Liu
2024-08-20 6:29 ` Al Viro
2024-08-20 7:23 ` Song Liu
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=20240823.zeiC0zauhah1@digikod.net \
--to=mic@digikod.net \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=gnoack@google.com \
--cc=jack@suse.cz \
--cc=kernel-team@meta.com \
--cc=kpsingh@kernel.org \
--cc=liamwisehart@meta.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=lltang@meta.com \
--cc=martin.lau@linux.dev \
--cc=mattbobrowski@google.com \
--cc=paul@paul-moore.com \
--cc=shankaran@meta.com \
--cc=song@kernel.org \
--cc=songliubraving@meta.com \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).