glibc/sysdeps/unix/sysv/linux
Florian Weimer 035c012e32 Reduce the statically linked startup code [BZ #23323]
It turns out the startup code in csu/elf-init.c has a perfect pair of
ROP gadgets (see Marco-Gisbert and Ripoll-Ripoll, "return-to-csu: A
New Method to Bypass 64-bit Linux ASLR").  These functions are not
needed in dynamically-linked binaries because DT_INIT/DT_INIT_ARRAY
are already processed by the dynamic linker.  However, the dynamic
linker skipped the main program for some reason.  For maximum
backwards compatibility, this is not changed, and instead, the main
map is consulted from __libc_start_main if the init function argument
is a NULL pointer.

For statically linked binaries, the old approach based on linker
symbols is still used because there is nothing else available.

A new symbol version __libc_start_main@@GLIBC_2.34 is introduced because
new binaries running on an old libc would not run their ELF
constructors, leading to difficult-to-debug issues.
2021-02-25 12:13:02 +01:00
..
aarch64 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
alpha Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
arc Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
arm Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
bits sysconf: Add _SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305] 2021-02-01 11:00:52 -08:00
csky Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
generic linux: Remove stat-check.c 2021-02-11 08:02:16 -03:00
hppa Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
i386 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
ia64 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
include
m68k Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
microblaze Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
mips Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
net
netash
netatalk
netax25
neteconet
netinet
netipx
netiucv
netpacket
netrom
netrose
nfs
nios2 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
powerpc Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
riscv Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
s390 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
scsi
sh Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
sparc Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
sys Add MS_NOSYMFOLLOW from Linux 5.10 to <sys/mount.h>. 2021-02-02 01:17:00 +00:00
wordsize-64 linux: Consolidate statvfs implementations 2021-02-11 08:00:41 -03:00
x86 nptl: Move elision implementations into libc 2021-02-23 14:59:34 +01:00
x86_64 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
Implies
Makefile linux: Consolidate internal_statvfs 2021-02-11 08:00:48 -03:00
Versions
_G_config.h
_exit.c
a.out.h
accept.c
accept4.c
access.c
adjtime.c
adjtimex.c
aio_misc.h
aio_sigqueue.c
alphasort64.c
arch-fd_to_filename.h
arch-fork.h
bind.c
brk.c
check_native.c
check_pf.c
clock.c
clock_adjtime.c
clock_getcpuclockid.c
clock_getres.c
clock_gettime.c
clock_nanosleep.c
clock_settime.c
close.c
close_nocancel.c
closedir.c
cmsg_nxthdr.c
cnd_timedwait.c
configure
configure.ac
connect.c
copy_file_range.c
creat.c
creat64.c
createthread.c
default-sched.h
device-nrs.h
dirfd.c
dirstream.h
dl-execstack.c
dl-fxstatat64.c
dl-getcwd.c
dl-librecon.h
dl-openat64.c
dl-opendir.c
dl-origin.c
dl-osinfo.h
dl-sbrk.c
dl-sysdep.c
dl-sysdep.h
dl-vdso-setup.c
dl-vdso-setup.h
dl-vdso.h
dl-write.c
dl-writev.h
epoll_pwait.c
epoll_wait.c
errlist-compat.c
errlist-compat.h
errqueue.h
eventfd_read.c
eventfd_write.c
exit-thread.h
faccessat.c
fallocate.c
fallocate64.c
fatal-prepare.h
fchmodat.c
fcntl.c
fcntl64.c
fcntl_nocancel.c
fdatasync.c
fdopendir.c
fexecve.c
filter-nr-syscalls.awk
fips-private.h
fixup-asm-unistd.h
fpathconf.c
fstat.c
fstat64.c
fstatat.c
fstatat64.c linux: Remove stat-check.c 2021-02-11 08:02:16 -03:00
fstatfs.c linux: Consolidate fstatfs implementations 2021-02-11 07:58:31 -03:00
fstatfs64.c linux: Consolidate fstatfs implementations 2021-02-11 07:58:31 -03:00
fstatvfs.c linux: Consolidate internal_statvfs 2021-02-11 08:00:48 -03:00
fstatvfs64.c linux: Consolidate internal_statvfs 2021-02-11 08:00:48 -03:00
fsync.c
ftime.c
ftruncate.c
ftruncate64.c
futimens.c
futimes.c
futimesat.c
fxstat.c
fxstat64.c
fxstatat.c
fxstatat64.c
gai_sigqueue.c
gen-syscall-h.awk
gentempfd.c
getclktck.c
getcpu.c
getcwd.c
getdents.c
getdents64.c
getdirentries.c
getdirentries64.c
getdtsz.c
getentropy.c
gethostid.c
getipv4sourcefilter.c
getitimer.c
getloadavg.c
getlogin.c
getlogin_r.c
getpagesize.c
getpeername.c
getpriority.c
getpt.c
getrandom.c
getrlimit.c
getrlimit64.c
getrusage.c
getsockname.c
getsockopt.c
getsourcefilter.c
getsourcefilter.h
getsysstats.c
gettimeofday.c
glibcsyscalls.py
glob-lstat-compat.c
glob.c
glob64-lstat-compat.c
glob64.c
globfree.c
globfree64.c
grantpt.c
if_index.c
ifaddrs.c
ifreq.c
internal-signals.h
internal_statvfs.c linux: Consolidate internal_statvfs 2021-02-11 08:00:48 -03:00
internal_statvfs.h linux: Consolidate internal_statvfs 2021-02-11 08:00:48 -03:00
ipc_ops.h
ipc_priv.h
kernel-features.h
kernel-posix-cpu-timers.h
kernel-posix-timers.h
kernel_sigaction.h
kernel_stat.h linux: Set default kernel_stat.h to LFS 2021-02-11 07:58:05 -03:00
kernel_termios.h
kstat_cp.h
ldd-rewrite.sed
lddlibc4.c
ldsodefs.h
libc-vdso.h
libc_fatal.c
linux_fsinfo.h
listen.c
local-setxid.h
lseek.c
lseek64.c
lstat.c
lstat64.c
lutimes.c
lxstat.c
lxstat64.c
malloc-sysdep.h
mknodat.c
mlock2.c
mmap.c
mmap64.c
mmap_internal.h
mq_close.c
mq_getattr.c
mq_notify.c
mq_open.c
mq_receive.c
mq_send.c
mq_timedreceive.c
mq_timedsend.c
mq_unlink.c
msgctl.c
msgget.c
msgrcv.c
msgsnd.c
msync.c
mtx_timedlock.c
nanosleep.c
netlink_assert_response.c
netlinkaccess.h
nice.c
not-cancel.h
not-errno.h
nscd_setup_thread.c
ntp_gettime.c
ntp_gettimex.c
olddirent.h
oldglob.c
open.c
open64.c
open64_nocancel.c
open_by_handle_at.c
open_nocancel.c
openat.c
openat64.c
openat64_nocancel.c
openat_nocancel.c
opendir.c
opensock.c
pathconf.c
pathconf.h
paths.h
pause.c
personality.c
pkey_get.c
pkey_mprotect.c
pkey_set.c
poll.c
posix_fadvise.c
posix_fadvise64.c
posix_fallocate.c
posix_fallocate64.c
posix_madvise.c
ppoll.c
prctl.c
pread.c
pread64.c
pread64_nocancel.c
preadv.c
preadv2.c
preadv64.c
preadv64v2.c
prlimit.c
process_vm_readv.c
process_vm_writev.c
prof-freq.c
profil-counter.h
profil.c
pselect.c
pselect32.c
pt-raise.c
pthread-pids.h
pthread_getcpuclockid.c
pthread_kill.c
pthread_sigqueue.c
ptrace.c
ptsname.c
pwrite.c
pwrite64.c
pwritev.c
pwritev2.c
pwritev64.c
pwritev64v2.c
raise.c
read.c
read_nocancel.c
readahead.c
readdir.c
readdir64.c
readdir64_r.c
readdir_r.c
readonly-area.c
readv.c
reboot.c
recv.c
recvfrom.c
recvmmsg.c
recvmsg.c
remove.c
rename.c
renameat.c
renameat2.c
rewinddir.c
sa_len.c
safe-fatal.h
scandir64.c
sched_getaffinity.c
sched_getcpu.c
sched_rr_gi.c
sched_setaffinity.c
seekdir.c
segfault.c
select.c
semctl.c
semget.c
semop.c
semtimedop.c
send.c
sendmmsg.c
sendmsg.c
sendto.c
setegid.c
seteuid.c
setgid.c
setgroups.c
sethostid.c
setipv4sourcefilter.c
setitimer.c
setregid.c
setresgid.c
setresuid.c
setreuid.c
setrlimit.c
setrlimit64.c
setsockopt.c
setsourcefilter.c
settimeofday.c
settimezone.c
setuid.c
shlib-versions
shmat.c
shmctl.c
shmdt.c
shmget.c
shutdown.c
sigaction.c
siglist-compat.c
signal.c
signalfd.c
sigpending.c
sigprocmask.c
sigqueue.c
sigreturn.c
sigset-cvt-mask.h
sigsetops.h
sigstack.c
sigsuspend.c
sigtimedwait.c
sigwait.c
sigwaitinfo.c
single-thread.h
sizes.h
socket.c
socketcall.h
socketpair.c
spawni.c
speed.c
splice.c
stat.c
stat64.c
stat_t64_cp.c
stat_t64_cp.h
statfs.c linux: Consolidate statfs implementations 2021-02-11 08:00:11 -03:00
statfs64.c linux: Consolidate statfs implementations 2021-02-11 08:00:11 -03:00
statvfs.c linux: Consolidate internal_statvfs 2021-02-11 08:00:48 -03:00
statvfs64.c linux: Consolidate internal_statvfs 2021-02-11 08:00:48 -03:00
statx.c
statx_cp.c
statx_cp.h
struct_kernel_msqid64_ds.h
struct_kernel_semid64_ds.h
struct_kernel_shmid64_ds.h
struct_stat_time64.h
sync_file_range.c
syscall-names.list Update syscall lists for Linux 5.11. 2021-02-19 21:16:27 +00:00
syscalls.list
sysconf-sigstksz.h sysconf: Add _SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305] 2021-02-01 11:00:52 -08:00
sysconf.c sysconf: Add _SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305] 2021-02-01 11:00:52 -08:00
sysctl.c
sysdep-cancel.h
sysdep-vdso.h
sysdep.h
syslog.c
tcdrain.c
tcflow.c
tcflush.c
tcgetattr.c
tcgetpgrp.c
tcsendbrk.c
tcsetattr.c
tcsetpgrp.c
tee.c
telldir.c
termio.h
test-errno-linux.c
thrd_priv.h
thrd_sleep.c
time-clockid.h
time.c
time64-support.c
time64-support.h
timer_create.c
timer_delete.c
timer_getoverr.c
timer_gettime.c
timer_routines.c
timer_settime.c
timerfd_gettime.c
timerfd_settime.c
times.c
timespec_get.c
tls-internal.c
tls-internal.h
truncate.c
truncate64.c
tst-affinity-pid.c
tst-affinity-static.c
tst-affinity.c
tst-align-clone.c
tst-clone.c
tst-clone2.c
tst-clone3.c
tst-fallocate-common.c
tst-fallocate.c
tst-fallocate64.c
tst-fanotify.c
tst-getdents64.c linux: mips: Fix getdents64 fallback on mips64-n32 2021-01-22 15:44:41 -03:00
tst-getpid1.c
tst-gettid-kill.c
tst-gettid.c
tst-glibcsyscalls.py
tst-memfd_create.c
tst-mlock2.c
tst-mman-consts.py
tst-o_path-locks.c
tst-ofdlocks-compat.c
tst-ofdlocks.c
tst-personality.c
tst-pkey.c
tst-ppoll.c tst: Provide test for ppoll 2021-02-08 09:20:03 +01:00
tst-quota.c
tst-readdir64-compat.c
tst-rlimit-infinity.c
tst-sigcontext-get_pc.c
tst-signal-numbers.py
tst-skeleton-affinity.c
tst-skeleton-thread-affinity.c
tst-socket-consts.py
tst-sync_file_range.c
tst-syscall-list.sh
tst-sysconf-iov_max-uapi.c
tst-sysconf-iov_max.c
tst-sysvmsg-linux.c
tst-sysvsem-linux.c
tst-sysvshm-linux.c linux: Remove shmmax check from tst-sysvshm-linux 2021-02-02 11:20:42 -03:00
tst-tgkill.c
tst-timerfd.c tst: Provide test for timerfd related functions 2021-02-08 09:19:44 +01:00
tst-ttyname.c
ttyname.c
ttyname.h
ttyname_r.c
tv32-compat.h
ualarm.c
umount.c
umount2.c
unlockpt.c
update-syscall-lists.py
updwtmp.c
ustat.c
utime.c
utimensat.c
utimes.c
utmp_file.c
versionsort64.c
vfork.c
vmsplice.c
wait3.c
wait4.c
waitid.c
write.c
write_nocancel.c
writev.c
xmknod.c
xmknodat.c
xstat.c
xstat64.c
xstatconv.c linux: Set default kernel_stat.h to LFS 2021-02-11 07:58:05 -03:00
xstatconv.h
xstatover.h
xstatver.h