[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
PR/55043 CVS commit: src/libexec/ld.elf_so
The following reply was made to PR toolchain/55043; it has been noted by GNATS.
From: "Jason R Thorpe" <thorpej%netbsd.org@localhost>
Subject: PR/55043 CVS commit: src/libexec/ld.elf_so
Date: Wed, 4 Mar 2020 01:21:17 +0000
Module Name: src
Committed By: thorpej
Date: Wed Mar 4 01:21:17 UTC 2020
src/libexec/ld.elf_so: headers.c map_object.c rtld.c
PT_GNU_RELRO segments are arranged such that their vaddr + memsz ends
on a linker common page size boundary. However, if the common page size
used by the linker is less than the VM page size being used by the kernel,
this can end up in the middle of a VM page and when the region is write-
protected, this can cause objects in neighboring .data to get incorrectly
write-protected, resulting in a crash.
Avoid this situation by calculating the end of the RELRO region not by
rounding memsz up to the VM page size, but rather by adding vaddr + memsz
and then truncating to the VM page size.
Fixes PR toolchain/55043.
To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/libexec/ld.elf_so/headers.c
cvs rdiff -u -r1.60 -r1.61 src/libexec/ld.elf_so/map_object.c
cvs rdiff -u -r1.202 -r1.203 src/libexec/ld.elf_so/rtld.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Main Index |
Thread Index |