Page MenuHomeFreeBSD

improve error checking for modifcations to mmap len parameter
ClosedPublic

Authored by dougm on Jun 10 2019, 7:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 29 2023, 4:43 AM
Unknown Object (File)
Dec 20 2023, 3:39 AM
Unknown Object (File)
Nov 22 2023, 5:09 PM
Unknown Object (File)
Oct 19 2023, 10:56 PM
Unknown Object (File)
Sep 15 2023, 6:59 AM
Unknown Object (File)
Sep 1 2023, 9:36 PM
Unknown Object (File)
Sep 1 2023, 9:35 PM
Unknown Object (File)
Sep 1 2023, 9:33 PM
Subscribers

Details

Summary

Change the check for 'size' wrapping around to zero in kern_mmap to account for both the lower and upper bound modifications. Change the error returned to ENOMEM. Rename the parameter size to len and make size a local variable that stores the value of len after it has been modified.

This addresses concerns expressed by Bruce Evans after r348843.

Diff Detail

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

Event Timeline

This revision is now accepted and ready to land.Jun 10 2019, 7:57 PM
This revision was automatically updated to reflect the committed changes.

I do not seem to be able to boot successfully with this patch?

alc added inline comments.
head/sys/vm/vm_mmap.c
262

Shouldn't this be (size < len)?

head/sys/vm/vm_mmap.c
262

Yes, it should.