diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-08-06 00:01:18 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-08-06 00:01:18 +0200 |
commit | a143381a7df825e2ae41e49a4bff00ce8b1d5e18 (patch) | |
tree | 2dcfa29d20432666f19dd5d85d55b2237aa3d5d6 | |
parent | 0bf9da2956ade2a7d3baccd920fcc1e23a425a07 (diff) |
Use commit messaget/pie-sbrk
-rw-r--r-- | .topmsg | 40 |
1 files changed, 24 insertions, 16 deletions
@@ -1,21 +1,29 @@ -Subject: Fix sbrk in PIE binaries +Committed from glibc 2.33 -In PIE mode, the program gets loaded at very low address, and thus _end is very -low, just before libraries, and thus initializing the brk to it does not make -sense, since there is no room left there. Hardcode the brk to 0x8000000 for now -as a workaround. +From: Samuel Thibault <samuel.thibault@ens-lyon.org> -id:"20130211040854.GN5926@type.youpi.perso.aquilenet.fr" +hurd: Rework sbrk -<http://darnassus.sceen.net/~hurd-web/open_issues/gcc/pie/> +Making the brk start exactly at the end of the main application binary was +requiring to get it through the _end symbol, which does not work any more +with recent toolchains, and actually produces in libc.so a confusing +external _end symbol that produces odd results, see +https://sourceware.org/bugzilla/show_bug.cgi?id=23499 -YYYY-MM-DD Samuel Thibault <samuel.thibault@ens-lyon.org> - Thomas Schwinge <thomas@codesourcery.com> +Trying to do so is quite outdated anyway with the tendency for address +randomization. + +Using _end was also allowing to include the main binary data within +the RLIMIT_DATA, but this also seems outdated with dynamic library +loading, and nowadays' memory consumption via malloc and mmap rather than +statically-allocated data. + +This adds a BRK_START macro in <vm_param.h> that just tells where we +want to start the brk, and thus removes the _end symbol. + +* sysdeps/mach/hurd/i386/vm_param.h: New file. +* sysdeps/mach/hurd/brk.c: Use BRK_START as brk start instead of _end. +Also ignore __data_start. +* hurd/Versions: Remove _end symbol. +* sysdeps/mach/hurd/i386/libc.abilist: Remove _end symbol. - * sysdeps/mach/hurd/brk.c (init_brk): Fix for PIE executables. - * misc/tst-sbrk.c: New file. - * misc/tst-sbrk-pie.c: Likewise. - * misc/tst-sbrk-static.c: Likewise. - * misc/Makefile (tests): Add tst-sbrk, tst-sbrk-pie, tst-sbrk-static. - (tests-pie): Add tst-sbrk-pie. - (tests-static): Add tst-sbrk-static. |