[PATCH 2/2] malloc: make malloc fail with requests larger than PTRDIFF_MAX

Florian Weimer fw@deneb.enyo.de
Thu Dec 27 22:46:00 GMT 2018


I think this is more a kernel matter: The kernel should create a
PROT_NONE mapping spanning two pages in the middle of the address
space, for those architectures where this mapping can actually be
created (so not x86-64, for example).  This could be controlled by a
personality flag.  (It wouldn't have to be a PROT_NONE mapping, just
something that can only be overridden using MAP_FIXED.)

On the other hand, this is primarily a C/C++ language issue (and a GCC
problem), so maybe it's not appropriate to change kernel behavior
because userspace could execute code written in other languages and
compiled by other compilers.



More information about the Libc-alpha mailing list