diff options
author | Sv. Lockal <lockalsash@gmail.com> | 2024-01-27 10:44:55 +0000 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2024-01-27 13:04:16 -0500 |
commit | 1f7d3654498e17e0a91c83f57e6265e08628d5fe (patch) | |
tree | 07f1f2554f394aec8f1daa2631cc8fbab0fa6bd3 /libsandbox/wrapper-funcs/truncate64.c | |
parent | libsandbox: stat the original path for EEXIST hackaround (diff) | |
download | sandbox-master.tar.gz sandbox-master.tar.bz2 sandbox-master.zip |
In https://github.com/google/googletest/blob/v1.14.0/googletest/src/gtest-death-test.cc#L1307
on x86-64 gtest sallocates 8192 bytes for `clone`:
```
static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {
const auto stack_size = static_cast<size_t>(getpagesize() * 2);
...
child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);
```
After that attempt to call execv is intercepted by libsandbox.so, which
allocates 8192 + more bytes multiple times on stack, causing SIGSEGV
(instead of expected types of crashes).
This PR moves all allocations for related function to heap, so now
call path fits `getpagesize() * 2` with large margin.
Bug: https://bugs.gentoo.org/923013
Closes: https://github.com/gentoo/sandbox/pull/26
Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'libsandbox/wrapper-funcs/truncate64.c')
0 files changed, 0 insertions, 0 deletions