mmap64 with very large offset broken since glibc 2.26 (MIPS64 n32)

Zack Weinberg zackw@panix.com
Thu Jun 13 17:36:00 GMT 2019


On Thu, Jun 13, 2019 at 1:19 PM Thomas De Schampheleire
<patrickdepinguin@gmail.com> wrote:
> In this thread there was some discussion about the syscall convention,
> but actually: with glibc since 2.26, there is no actual syscall made
> anymore: it is glibc that does a preliminary check on the offsets, and
> returns early if the offset is considered too large.

Right, but this preliminary check is a workaround for what we
_thought_ was a kernel limitation, where the `mmap64` syscall doesn't
allow you to pass an offset larger than 1<<44.  Your program working
with glibc <2.26 indicates that this kernel limitation does not exist
on at least some architectures, but to remove the check safely, we
need to understand exactly what is and is not possible at the syscall
level on all supported architectures and ABIs.

zw



More information about the Libc-alpha mailing list