Re: [PATCH v6 bpf-next 3/4] bpf: add bpf_init_inode_xattr kfunc for atomic inode labeling

"Kumar Kartikeya Dwivedi" <[email protected]> Sat, 01 Aug 2026 01:14:12 +0200
Newsgroups org.kernel.vger.selinux,org.kernel.vger.bpf,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-integrity,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kernel.vger.linux-security-module
Message-ID <[email protected]>
On Sat Aug 1, 2026 at 1:01 AM CEST, Casey Schaufler wrote:
> On 7/31/2026 3:45 PM, Kumar Kartikeya Dwivedi wrote:
>> On Sat Aug 1, 2026 at 12:27 AM CEST, Casey Schaufler wrote:
>>> On 7/31/2026 3:04 PM, Kumar Kartikeya Dwivedi wrote:
>>>> On Fri Jul 31, 2026 at 11:49 PM CEST, Paul Moore wrote:
>>>>> On Fri, Jul 31, 2026 at 5:29=E2=80=AFPM Kumar Kartikeya Dwivedi
>>>>> <[email protected]> wrote:
>>>>>> On Fri Jul 31, 2026 at 10:48 PM CEST, Paul Moore wrote:
>>>>>>> On Fri, Jul 31, 2026 at 4:16=E2=80=AFPM Kumar Kartikeya Dwivedi
>>>>>>> <[email protected]> wrote:
>>>>>>>> On Fri Jul 31, 2026 at 10:01 PM CEST, Paul Moore wrote:
>>>>>>>>> On Fri, Jul 31, 2026 at 3:20=E2=80=AFPM Kumar Kartikeya Dwivedi
>>>>>>>>> <[email protected]> wrote:
>>>>>>>>>> On Fri Jul 31, 2026 at 9:05 PM CEST, Paul Moore wrote:
>>>>>>>>>>> On Fri, Jul 31, 2026 at 2:50=E2=80=AFPM Kumar Kartikeya Dwivedi
>>>>>>>>>>> <[email protected]> wrote:
>>>>>>>>>>>> On Fri Jul 31, 2026 at 8:42 PM CEST, Paul Moore wrote:
>>>>>>>>>>>>> On Fri, Jul 31, 2026 at 2:18=E2=80=AFPM Kumar Kartikeya Dwive=
di
>>>>>>>>>>>>> <[email protected]> wrote:
>>>>>>>>>>>>>> On Fri Jul 31, 2026 at 6:59 PM CEST, Paul Moore wrote:
>>>>>>>>>>>>>>> On Fri, Jul 31, 2026 at 12:32=E2=80=AFPM Kumar Kartikeya Dw=
ivedi
>>>>>>>>>>>>>>> <[email protected]> wrote:
>>>>>>>>>>>>>>>> On Fri Jul 31, 2026 at 6:02 PM CEST, Paul Moore wrote:
>>>>>>>>>>>>>>>>> On Fri, Jul 31, 2026 at 11:44=E2=80=AFAM Kumar Kartikeya =
Dwivedi
>>>>>>>>>>>>>>>>> <[email protected]> wrote:
>>>>>>>>>>>>>>>>>> On Fri Jul 31, 2026 at 5:30 PM CEST, David Windsor wrote=
:
>>>>>>>>>>>>>>>>>>> On Fri, Jul 31, 2026 at 11:17=E2=80=AFAM Paul Moore <pa=
[email protected]> wrote:
>>>>> ...
>>>>>
>>>>>> I think you keep forgetting that you cannot unilaterally decide this=
. Both VFS
>>>>>> and BPF people have told you that it does not make sense. What was c=
learly LSM
>>>>>> specific code has been moved under security/ already.
>>>>> I'm charged with doing the Right Thing for the LSM framework, and in
>>>>> my opinion it is in the best interest of the LSM framework that the
>>>>> kfunc being proposed lives in security/bpf_lsm_kfuncs.c, just as the
>>>>> VFS kfuncs live in fs/bpf_fs_kfuncs.c.
>>>>>
>>>> I think the "Right Thing" would be caring about your users and the pro=
ject
>>>> moving forward, who want this functionality, and figuring out the best=
 way to
>>>> make it happen while working collaboratively with others. Life is full=
 of
>>>> tradeoffs.
>>> It certainly is. Paul has taken a stance that supports the ongoing main=
tenance
>>> of the LSM subsystem. It does not have a stable API in support of the r=
apid
>>> development of Linux kernel features *outside of* the LSM infrastructur=
e. That is,
>>> people like you. If LSM hook implementations were spread throughout the=
 kernel
>>> code it would be much more difficult for poor hobbyist LSM developers l=
ike me
>>> to track them down when making changes. Changes like the ones you requi=
re.
>> I would recommend reading the patches before commenting. All LSM code is=
 under
>> security/ (patch 2), as it should be.
>
> Pa-lease. I have in fact read the patch. I disagree with you assessment.
>
>>> This is about being able to continue supporting the latest and greatest=
 additions
>>> to the system. Like yours, io_uring and the network protocol d'jour.
>>>
>> I don't know what you're on about.
>>
>>> Please don't lecture us on collaboration and trade-offs. We live and br=
eath that.
>>>
>> Paul is free to take a stance for LSM code, just like the BPF maintainer=
s get to
>> decide on where BPF related code should live. I'm sure you know that.
>>
>> Thus, please avoid justifying his overreach on where others maintainers =
should
>> keep their code.
>
> I have been developing kernel code since the 1970's (UNIX and Linux) and =
have
> a fair bit of understanding about source code organization. Without ratio=
nal
> layering and co-location chaos ensues. The BPF developers are newbies rel=
ative
> to the security maintainers, and would do well to pay some attention to t=
he
> wisdom of the aged.

I am certainly more inexperienced than you, granted. But I don't think we
resolve issues by older people forcing their opinions on younger people.

We do that by providing sensibile rationale behind technical choices. I am
constantly doing that and receiving unsubstantiated wisdom in response.

Common sense suggests related code (all xattr kfuncs) should stay together =
in
one file. If they need moving, they should move together.

There is disagreement on where this file should be located between Paul and=
 the
BPF maintainers (even VFS maintainters), therefore Paul does not get to mak=
e a
mess of our code.

Having one kfunc stay in one file (Paul's suggestion) while others are in
another file is the worst option.

There is no layering violation, all LSM logic resides in the LSM subsystem,=
 with
clean APIs exported for use elsewhere. I am sure you don't consider BPF dyn=
ptr
as LSM logic.

The hodge podge state you're arguing against is what Paul is suggesting.

Thanks