[PATCH v2 3/5] rust: kernel: add LSM abstraction layer
Miguel Ojeda
miguel.ojeda.sandonis at gmail.com
Wed Mar 11 06:49:58 UTC 2026
On Wed, Mar 11, 2026 at 6:09 AM Jamie Lindsey <jamie at matrixforgelabs.com> wrote:
>
> Assisted-by: Claude:claude-sonnet-4-6
Thanks for disclosing that (I think the cover letter was also written
by an LLM, right?).
Without taking a deep look, it seems heavily LLM generated (em dashes
and all), and it doesn't look like it was reviewed much after
generation (which probably led to the missing SoBs in v1).
For instance, without reading the code, just from scrolling through
the email, it is clear it doesn't follow the usual Linux conventions
(or our Rust kernel ones):
- The cover letter lists the commits at the bottom, probably
generated by the LLM trying to be useful, but Git already does that
immediately after.
- The commit message here mentions "This is v1", which isn't true.
Even if it were true, it is not something commit messages would
normally mention.
- It also mentions v1 and things like "Planned for v2" in the code
itself, which even way more uncommon.
- The docs use section more verbose, custom headers instead of the
standard `# Examples` and `# Safety`, and doesn't use intra-doc links
in the places we would normally do, and doesn't use Markdown
consistently.
- The imports don't use the prelude nor the kernel imports style.
- Some comments aren't true and they aren't needed anyway, like the
`bindgen` one.
In particular, since these are Rust abstractions, I would be wary of
the soundness of code an LLM generates. The latest models are very
powerful, but I have seen even better models that the one used here
generate unsound Rust code before that, and for easier code than this.
For instance, one of the non-standard `# Safety` sections here seems
to apply to a safe trait for some reason. And I wonder if the custom
header was used by the LLM to be able to keep its own explanations and
yet satisfy Clippy...
Anyway, the summary is that kernel code can be assisted by an LLM, but
the end result should be as-if you had written it.
I hope that helps.
Cheers,
Miguel
More information about the Linux-security-module-archive
mailing list