Page MenuHomeFreeBSD

Assign map->header values to avoid boundary checks
ClosedPublic

Authored by dougm on Jan 2 2018, 6:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 10, 1:08 PM
Unknown Object (File)
Sat, Mar 9, 7:16 PM
Unknown Object (File)
Jan 17 2024, 1:02 PM
Unknown Object (File)
Dec 20 2023, 5:09 AM
Unknown Object (File)
Dec 8 2023, 4:50 AM
Unknown Object (File)
Nov 14 2023, 6:22 PM
Unknown Object (File)
Nov 9 2023, 10:37 PM
Unknown Object (File)
Nov 7 2023, 2:47 PM
Subscribers

Details

Summary

In several places, entry start and end field are checked, after excluding the possibility that the entry is map->header. By assigning max and min values to the start and end fields of map->header in vm_map_init, the explicit map->header checks become unnecessary.

Diff Detail

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

Event Timeline

Associate min_offset and max_offset with header.end and header.start, respectively.

Eliminate unneeded &map->header checks in vm_mmap.c.

Peter Holm, can you please stress test this patch at your convenience?

In D13735#291224, @dougm_rice.edu wrote:

Peter Holm, can you please stress test this patch at your convenience?

I ran all of the stress2 tests. Half on amd64 and half on i386. No problems seen.

This revision is now accepted and ready to land.Jan 16 2018, 11:20 AM
markj added inline comments.
sys/vm/vm_map.c
2270 ↗(On Diff #37437)

While you're here, perhaps fix style and move the closing paren and opening brace to the end of the previous line? Ditto below.

Make recommended formatting changes to a couple of loops.

This revision now requires review to proceed.Jan 16 2018, 6:02 PM

Add a comment regarding the use of sentinel values.

I have addressed the comments (made offline) from alc. He has stated that he has no objections to the resulting patch, but that I will have to rely on someone else to give it final approval and checkin. I'd appreciate that help from somebody, please.

This revision is now accepted and ready to land.Jan 20 2018, 8:18 AM
sys/vm/vm_map.c
2270 ↗(On Diff #38240)

Please deindent by one space on this continuation line.

2315 ↗(On Diff #38240)

Please deindent by one space on this continuation line.

Apply suggested changes to indentation.

This revision now requires review to proceed.Jan 20 2018, 9:25 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 20 2018, 12:19 PM
This revision was automatically updated to reflect the committed changes.