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
F162895205: D54673.id.diff
Sat, Jul 18, 2:33 AM
Unknown Object (File)
Wed, Jul 15, 7:02 AM
Unknown Object (File)
Wed, Jul 15, 7:02 AM
Unknown Object (File)
Sat, Jul 4, 12:00 PM
Unknown Object (File)
Jun 18 2026, 9:28 AM
Unknown Object (File)
Jun 17 2026, 2:23 AM
Unknown Object (File)
Jun 12 2026, 12:36 PM
Unknown Object (File)
May 7 2026, 11:29 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.