DescriptionSECCOMP-BPF: Fix SandboxSyscall()
- Eliminate variadic arguments in favor of C++ templates.
This makes ASAN and Valgrind much happier, as we are no
longer accessing more arguments than what has been passed
into our function (i.e. in the past, we'd always forward
six arguments to the kernel, even if the system call
needed fewer; now, we explicitly pass zeros).
- In the past, callers had to be very careful when passing
NULL, as the C++ compiler was likely to treat this macro
as a 32bit integer value rather than a 64bit pointer. We
now always perform sign extension for expanding arguments
to the full native word width.
- On x86-64, we could clobber up to eight (in some cases 16)
bytes in the red zone. This would typically only happen
when high optimization levels were turned on, and in many
cases it ended up overwriting data that was no longer
needed. But we have seen at least one case where we ended
up clobbering a system call parameter. We now explicitly
avoid the red zone and this problem can no longer happen.
BUG=163904, 162925
TEST=sandbox_linux_unittests
NOTRY=true
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=170896
Patch Set 1 #
Total comments: 16
Patch Set 2 : Fix the handling of red zones. This fixes a crash on the bots and overall makes valgrind much happi… #Patch Set 3 : Addressed Jeffrey's comments #
Messages
Total messages: 11 (0 generated)
|