[PATCH] rust: cred: add safe abstractions for capable() and ns_capable()

Miguel Ojeda miguel.ojeda.sandonis at gmail.com
Fri May 15 19:07:30 UTC 2026


On Fri, May 15, 2026 at 7:13 PM Arnav Sharma <arnav4324 at gmail.com> wrote:
>
> I don't have an immediate in-tree use case for this. I'm fairly new to kernel development and was going through the existing Rust-for-Linux abstractions. I noticed that capable() and ns_capable() had no safe Rust wrappers and attempted to fill that gap — I was approaching it more from a "Hmm.. this seems missing" angle rather than "Do we even need it". I understand now that abstractions need concrete users to justify their inclusion, and I'll keep that in mind going forward.

Yeah, in general, all kernel code needs a user, i.e. a justification
for it to be added (i.e. it is a general rule, not just for Rust
abstractions).

Please see https://rust-for-linux.com/contributing#submitting-new-abstractions-and-modules
for some more details.

(By the way, your email uses HTML, so it may not reach the mailing
list. Please use plain text instead.)

Cheers,
Miguel



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