Page MenuHomeFreeBSD

munmap.2: Unaligned addresses do not return error
ClosedPublic

Authored by emaste on Jan 15 2025, 4:55 PM.
Tags
None
Referenced Files
F132047710: D48465.diff
Mon, Oct 13, 5:28 AM
Unknown Object (File)
Thu, Oct 9, 7:58 AM
Unknown Object (File)
Thu, Sep 25, 1:57 AM
Unknown Object (File)
Sep 12 2025, 2:54 PM
Unknown Object (File)
Sep 4 2025, 1:55 AM
Unknown Object (File)
Sep 3 2025, 12:19 AM
Unknown Object (File)
Aug 25 2025, 9:36 PM
Unknown Object (File)
Aug 25 2025, 2:11 PM

Details

Summary
We previously claimed that non-page-aligned addresses would return
EINVAL, but the address is in fact rounded down to the page boundary.

Fixes: dabee6fecc67 ("kern_descrip.c: add fdshare()/fdcopy()")

Diff Detail

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

Event Timeline

emaste created this revision.

Turn reference into a link: rGdabee6fecc67

Hm, this used to be required by POSIX but newer versions allow the implementation not to treat that as an error

brooks added a subscriber: brooks.

Ideally I'd like to see a note that the use of unaligned addresses is non-portable, but that's probably a separate commit.

This revision is now accepted and ready to land.Jan 15 2025, 5:52 PM