[all-commits] [llvm/llvm-project] af2bf8: [msan] Add 'MappingDesc::ALLOCATOR' type and check...
Thurston Dang via All-commits
all-commits at lists.llvm.org
Thu Mar 14 16:19:52 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: af2bf86a372cacf5f536bae06e2f2d3886eefb7b
https://github.com/llvm/llvm-project/commit/af2bf86a372cacf5f536bae06e2f2d3886eefb7b
Author: Thurston Dang <thurston at google.com>
Date: 2024-03-14 (Thu, 14 Mar 2024)
Changed paths:
M compiler-rt/lib/msan/msan.h
M compiler-rt/lib/msan/msan_allocator.cpp
M compiler-rt/lib/msan/msan_linux.cpp
Log Message:
-----------
[msan] Add 'MappingDesc::ALLOCATOR' type and check it is available (#85153)
MSan divides the virtual address space into APP, INVALID, SHADOW and
ORIGIN memory. The allocator usually just steals a bit of the APP
address space: typically the bottom portion of the PIE binaries section,
which works because the Linux kernel maps from the top of the PIE
binaries section. However, if ASLR is very aggressive, the binary may
end up mapped in the same location where the allocator wants to live;
this results in a segfault.
This patch adds in a MappingDesc::ALLOCATOR type and enforces that the
memory range for the allocator is not occupied by anything else.
Since the allocator range information is not readily available in
msan.h, we duplicate the information from msan_allocator.cpp.
Note: aggressive ASLR can also lead to a different type of failure,
where the PIE binaries/libraries are mapped entirely outside of the
APP/ALLOCATOR sections; that will be addressed in a separate patch
(https://github.com/llvm/llvm-project/pull/85142).
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list