]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Make SHMMAXPGS an unsigned long
authorAndrew Turner <andrew@FreeBSD.org>
Tue, 15 Mar 2022 17:42:30 +0000 (17:42 +0000)
committerAndrew Turner <andrew@FreeBSD.org>
Mon, 4 Apr 2022 09:37:07 +0000 (10:37 +0100)
commit51281d53e7849b0adde114e12e91d10c190f3149
tree0964926dc7e33537e633cf67d2987f6bb10425ff
parent5abab0f952ba98fb68cacc0d3f6cdafddf9ba629
Make SHMMAXPGS an unsigned long

This is used to calculate sizes that are then stored in unsigned long
fields. Make this unsigned long so the calculations use this type and
not an int that can lead to an integer overflow with a large PAGE_SIZE.

This allows building this on arm64 with PAGE_SIZE of 16k. Further work
will be needed if a 32-bit architecture tries to use a similar sized
page.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit cab496e16cb384de03010d9dea7399cbbfb3c3f9)
sys/kern/sysv_shm.c