Page MenuHomeFreeBSD

Return different error code for the guard page layout violation.
ClosedPublic

Authored by kib on Nov 21 2017, 10:01 PM.
Tags
None
Referenced Files
F158928104: D13186.id35590.diff
Sun, Jun 7, 9:00 PM
Unknown Object (File)
Fri, May 22, 11:07 PM
Unknown Object (File)
May 3 2026, 7:00 AM
Unknown Object (File)
Apr 28 2026, 8:06 PM
Unknown Object (File)
Apr 28 2026, 8:03 PM
Unknown Object (File)
Apr 28 2026, 1:01 AM
Unknown Object (File)
Apr 27 2026, 4:24 AM
Unknown Object (File)
Apr 21 2026, 7:00 AM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/vm/vm_map.c
3619–3621 ↗(On Diff #35568)

vm_map_insert() returns KERN_INVALID_ARGUMENT for all of these errors. I would argue that this function should do the same, both for consistency with vm_map_insert() and because KERN_INVALID_ARGUMENT better describes these errors.

Also, vm_map_insert() has a slighyly different "max" check. The equivalent would be "addrbos + max_ssize > vm_map_max(map)".

sys/vm/vm_map.c
3619–3621 ↗(On Diff #35568)

vm_map_insert()'s address wrap check also uses <= rather than <.

Duplicate the vm_map_insert() behavior for error checking WRT the address range checking.

I've skimmed the code for both this function and vm_map_insert(), and I believe that both the error checks and their corresponding return values are now consistent.

This revision is now accepted and ready to land.Nov 22 2017, 4:19 PM
This revision was automatically updated to reflect the committed changes.