]> git.ipfire.org Git - thirdparty/glibc.git/commit
libio: Set _vtable_offset before calling _IO_link_in [BZ #32148]
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 7 Sep 2024 15:32:32 +0000 (08:32 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 1 Oct 2024 03:18:53 +0000 (11:18 +0800)
commit5c06c6e0b5078ffb0aa0c09bac79f086145e0897
tree7728579237b5e61ca558ef7595b145b1968f4f26
parentcc256952ecb07789c423dff9712eb7a38f80e963
libio: Set _vtable_offset before calling _IO_link_in [BZ #32148]

Since _IO_vtable_offset is used to detect the old binaries, set it
in _IO_old_file_init_internal before calling _IO_link_in which checks
_IO_vtable_offset.  Add a glibc 2.0 test with copy relocation on
_IO_stderr_@GLIBC_2.0 to verify that fopen won't cause memory corruption.
This fixes BZ #32148.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
(cherry picked from commit 9dfea3de7f690bff70e3c6eb346b9ad082bb2e35)
libio/Makefile
libio/oldfileops.c
libio/tst-fopen-compat.c [new file with mode: 0644]