[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <D6F9A273-1D5A-4E4E-89E4-9A44F1AD06E8@fb.com>
Date: Tue, 15 Oct 2024 13:54:08 +0000
From: Song Liu <songliubraving@...a.com>
To: Christoph Hellwig <hch@...radead.org>
CC: Song Liu <songliubraving@...a.com>, Song Liu <song@...nel.org>,
bpf
<bpf@...r.kernel.org>,
Linux-Fsdevel <linux-fsdevel@...r.kernel.org>,
LKML
<linux-kernel@...r.kernel.org>,
Kernel Team <kernel-team@...a.com>,
Andrii
Nakryiko <andrii@...nel.org>,
Eduard Zingerman <eddyz87@...il.com>,
Alexei
Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin
KaFai Lau <martin.lau@...ux.dev>,
Al Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
KP Singh
<kpsingh@...nel.org>,
Matt Bobrowski <mattbobrowski@...gle.com>
Subject: Re: [PATCH bpf-next 2/2] selftests/bpf: Extend test fs_kfuncs to
cover security.bpf xattr names
Hi Christoph,
> On Oct 14, 2024, at 11:42 PM, Christoph Hellwig <hch@...radead.org> wrote:
>
> On Tue, Oct 15, 2024 at 05:52:02AM +0000, Song Liu wrote:
>>>> Do you mean user.* xattrs are untrusted (any user can set it), so we
>>>> should not allow BPF programs to read them? Or do you mean xattr
>>>> name "user.kfuncs" might be taken by some use space?
>>>
>>> All of the above.
>>
>> This is a selftest, "user.kfunc" is picked for this test. The kfuncs
>> (bpf_get_[file|dentry]_xattr) can read any user.* xattrs.
>>
>> Reading untrusted xattrs from trust BPF LSM program can be useful.
>> For example, we can sign a binary with private key, and save the
>> signature in the xattr. Then the kernel can verify the signature
>> and the binary matches the public key.
>
> I would expect that to be done through an actual privileged interface.
> Taking an arbitrary name that was available for use by user space
> programs for 20 years and now giving it a new meaning is not a good
> idea.
Agreed that using security.bpf xattrs are better for this use case.
In fact, this patchset adds the support for security.bpf xattrs.
Support for user.* xattrs were added last year.
Thanks,
Song
Powered by blists - more mailing lists