[PATCH] support: Align the repeated blob mappings to SHMLBA
Florian Weimer
fweimer@redhat.com
Tue Nov 3 10:19:14 GMT 2026
* Stian Halseth:
> allocate_big reserves the region with an anonymous mapping, which is
> only page aligned, and then maps the backing file over it with
> MAP_FIXED | MAP_SHARED. A shared mapping has to be aligned to SHMLBA,
> which is 16 KiB on sparc64 against an 8 KiB page, so the mapping fails
> with EINVAL whenever the reservation lands on an odd page.
> stdlib/test-bz22786 then crashes on the NULL start, and
> stdlib/tst-strtod-overflow and string/tst-memmove-overflow report
> UNSUPPORTED.
>
> Over-allocate the reservation and align its start, and make the stride
> a multiple of SHMLBA so that every shared alias is aligned too.
Would it work to use MAP_SHARED instead of MAP_PRIVATE for the PROT_NONE
reservation if the shared flag is true?
Thanks,
Florian
More information about the Libc-alpha
mailing list