[PATCH v1 bpf-next 0/5] af_unix: Allow BPF LSM to scrub SCM_RIGHTS at sendmsg().

Kuniyuki Iwashima kuniyu at amazon.com
Tue May 6 18:16:24 UTC 2025


From: Kumar Kartikeya Dwivedi <memxor at gmail.com>
Date: Tue, 6 May 2025 18:25:14 +0200
> Given you're probably going to drop scrubbing, all you'd need is to
> pass the pointer to file to inspect is f = bpf_core_cast(&fpl->fp[i],
> struct file).

Ah, I totally forgot bpf_core_cast().


> Then just find out the type of file using f->f_ops == something and if
> a disallowed file type is seen, return the verdict.

I'll change selftest as such.

Thanks!



More information about the Linux-security-module-archive mailing list