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
Unknown Object (File)
Tue, Feb 24, 12:20 PM
Unknown Object (File)
Tue, Feb 24, 4:15 AM
Unknown Object (File)
Thu, Feb 19, 5:26 AM
Unknown Object (File)
Wed, Feb 18, 7:46 AM
Unknown Object (File)
Tue, Feb 17, 1:58 AM
Unknown Object (File)
Sun, Feb 8, 7:23 AM
Unknown Object (File)
Sat, Feb 7, 5:18 PM
Unknown Object (File)
Feb 1 2026, 3:25 AM
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.