Page MenuHomeFreeBSD

linuxkpi: Clean up linux_shmem_file_setup() a bit
ClosedPublic

Authored by markj on Jan 12 2026, 6:56 PM.
Tags
None
Referenced Files
F168182796: D54673.id169535.diff
Wed, Aug 26, 6:27 PM
Unknown Object (File)
Mon, Aug 24, 3:31 PM
Unknown Object (File)
Mon, Aug 24, 7:16 AM
Unknown Object (File)
Sat, Aug 22, 4:01 PM
Unknown Object (File)
Sat, Aug 22, 4:01 PM
Unknown Object (File)
Sat, Aug 22, 10:02 AM
Unknown Object (File)
Sun, Aug 9, 2:49 AM
Unknown Object (File)
Sat, Aug 8, 5:33 PM
Subscribers

Details

Summary
  • Free the pointer that was returned by the allocator, instead of the address of the first member. These will be equal in practice, but it's sketchy and possibly won't work on CHERI.
  • Use an anonymous struct, there's no need to name it.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Jan 12 2026, 6:56 PM
This revision is now accepted and ready to land.Jan 14 2026, 4:26 PM
brooks added a subscriber: brooks.

In practice, this would be fine with default CHERI C, but broken with subobject bounds.