Page MenuHomeFreeBSD

linuxkpi: Clean up linux_shmem_file_setup() a bit
ClosedPublic

Authored by markj on Mon, Jan 12, 6:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 1, 3:25 AM
Unknown Object (File)
Sat, Jan 31, 6:22 AM
Unknown Object (File)
Wed, Jan 28, 1:30 AM
Unknown Object (File)
Mon, Jan 26, 4:48 PM
Unknown Object (File)
Sun, Jan 25, 11:20 AM
Unknown Object (File)
Sun, Jan 25, 6:39 AM
Unknown Object (File)
Sat, Jan 24, 6:00 AM
Unknown Object (File)
Fri, Jan 23, 10:05 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.Mon, Jan 12, 6:56 PM
This revision is now accepted and ready to land.Wed, Jan 14, 4:26 PM
brooks added a subscriber: brooks.

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