Module Name: src Committed By: thorpej Date: Wed Mar 4 01:21:17 UTC 2020
Modified Files: src/libexec/ld.elf_so: headers.c map_object.c rtld.c Log Message: 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. XXX pullup-9 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.