glibc/libio
Florian Weimer db3476aff1 libio: Implement vtable verification [BZ #20191]
This commit puts all libio vtables in a dedicated, read-only ELF
section, so that they are consecutive in memory.  Before any indirect
jump, the vtable pointer is checked against the section boundaries,
and the process is terminated if the vtable pointer does not fall into
the special ELF section.

To enable backwards compatibility, a special flag variable
(_IO_accept_foreign_vtables), protected by the pointer guard, avoids
process termination if libio stream object constructor functions have
been called earlier.  Such constructor functions are called by the GCC
2.95 libstdc++ library, and this mechanism ensures compatibility with
old binaries.  Existing callers inside glibc of these functions are
adjusted to call the original functions, not the wrappers which enable
vtable compatiblity.

The compatibility mechanism is used to enable passing FILE * objects
across a static dlopen boundary, too.
2016-06-23 20:01:52 +02:00
..
bits
__fbufsize.c
__flbf.c
__fpending.c
__fpurge.c
__freadable.c
__freading.c
__fsetlocking.c
__fwritable.c
__fwriting.c
bug-fopena+.c
bug-fseek.c
bug-ftell.c
bug-memstream1.c
bug-mmap-fflush.c
bug-rewind2.c
bug-rewind.c
bug-ungetc2.c
bug-ungetc3.c
bug-ungetc4.c
bug-ungetc.c
bug-ungetwc1.c
bug-ungetwc2.c
bug-wfflush.c
bug-wmemstream1.c
bug-wsetpos.c
clearerr_u.c
clearerr.c
Depend
fcloseall.c
feof_u.c
feof.c
ferror_u.c
ferror.c
filedoalloc.c libio: Clean up _IO_file_doallocate and _IO_wfile_doallocate 2016-03-07 17:05:06 +01:00
fileno.c
fileops.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
fmemopen.c libio: Fix fmemopen append mode failure (BZ# 20012) 2016-04-29 19:25:17 -03:00
fputc_u.c
fputc.c
fputwc_u.c
fputwc.c
freopen64.c
freopen.c
fseek.c
fseeko64.c
fseeko.c
ftello64.c
ftello.c
fwide.c
fwprintf.c
fwscanf.c
genops.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
getc_u.c
getc.c
getchar_u.c
getchar.c
getwc_u.c
getwc.c
getwchar_u.c
getwchar.c
iofclose.c
iofdopen.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
iofflush_u.c
iofflush.c
iofgetpos64.c
iofgetpos.c
iofgets_u.c
iofgets.c
iofgetws_u.c
iofgetws.c
iofopen64.c
iofopen.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
iofopncook.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
iofputs_u.c
iofputs.c
iofputws_u.c
iofputws.c
iofread_u.c
iofread.c
iofsetpos64.c
iofsetpos.c
ioftell.c
iofwide.c
iofwrite_u.c
iofwrite.c
iogetdelim.c
iogetline.c
iogets.c
iogetwline.c
iolibio.h
iopadn.c
iopopen.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
ioputs.c
ioseekoff.c
ioseekpos.c
iosetbuffer.c
iosetvbuf.c
ioungetc.c
ioungetwc.c
iovdprintf.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
iovsprintf.c
iovsscanf.c
iovswscanf.c
iowpadn.c
libc_fatal.c
libio.h
libioP.h libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
Makefile libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
memstream.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
obprintf.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
oldfileops.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
oldfmemopen.c
oldiofclose.c
oldiofdopen.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
oldiofgetpos64.c
oldiofgetpos.c
oldiofopen.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
oldiofsetpos64.c
oldiofsetpos.c
oldiopopen.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
oldpclose.c
oldstdfiles.c
oldtmpfile.c
pclose.c
peekc.c
putc_u.c
putc.c
putchar_u.c
putchar.c
putwc_u.c
putwc.c
putwchar_u.c
putwchar.c
rewind.c
setbuf.c
setlinebuf.c
stdfiles.c
stdio.c
stdio.h Fix stdio.h namespace for pre-threads POSIX (bug 20014). 2016-04-28 22:01:04 +00:00
strfile.h
strops.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
swprintf.c
swscanf.c
test-fmemopen.c
test-freopen.c
test-freopen.sh
tst_getwc.c
tst_getwc.input
tst_putwc.c
tst_swprintf.c
tst_swscanf.c
tst_wprintf2.c
tst_wprintf.c
tst_wscanf.c
tst_wscanf.input
tst-atime.c
tst-eof.c
tst-ext2.c
tst-ext.c
tst-fgetwc.c
tst-fgetwc.input
tst-fgetws.c
tst-fopenloc2.c
tst-fopenloc.c 2016-06-11 Paul Pluzhnikov <ppluzhnikov@google.com> 2016-06-11 14:50:16 -07:00
tst-fputws.c
tst-freopen.c
tst-fseek.c
tst-ftell-active-handler.c
tst-ftell-append.c
tst-ftell-partial-wide.c
tst-fwrite-error.c
tst-memstream1.c
tst-memstream2.c
tst-mmap2-eofsync.c 2016-06-11 Paul Pluzhnikov <ppluzhnikov@google.com> 2016-06-11 14:50:16 -07:00
tst-mmap-eofsync.c
tst-mmap-fflushsync.c
tst-mmap-offend.c
tst-mmap-setvbuf.c
tst-popen1.c
tst-setvbuf1.c
tst-sscanf.c
tst-swscanf.c
tst-ungetwc1.c
tst-ungetwc2.c
tst-widetext.c
tst-widetext.input
tst-wmemstream1.c
tst-wmemstream2.c
vasprintf.c
Versions
vscanf.c
vsnprintf.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
vswprintf.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
vtables.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
vwprintf.c
vwscanf.c
wfiledoalloc.c libio: Clean up _IO_file_doallocate and _IO_wfile_doallocate 2016-03-07 17:05:06 +01:00
wfileops.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
wgenops.c
wmemstream.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
wprintf.c
wscanf.c
wstrops.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00