aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_sandbox.c
AgeCommit message (Collapse)Author
2024-03-20test: Disable unit test causing issue with nightly packageDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-09-18Merge branch 'sandbox-aarch64-riscv-fixes' into 'main'David Goulet
Fix sandbox on AArch64, RISC-V Closes #24454 See merge request tpo/core/tor!446
2023-05-28hs_pow: Update for equix API to fix issue 40794Micah Elizabeth Scott
This change adapts the hs_pow layer and unit tests to API changes in hashx and equix which modify the fault recovery responsibilities and reporting behaivor. This and the corresponding implementation changes in hashx and equix form the fix for #40794, both solving the segfault and giving hashx a way to report those failures up the call chain without them being mistaken for a different error (unusable seed) that would warrant a retry. To handle these new late compiler failures with a minimum of fuss or inefficiency, the failover is delegated to the internals of hashx and tor needs only pass in a EQUIX_CTX_TRY_COMPILE flag to get the behavior that tor was previously responsible for implementing. Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-05-28test_sandbox: equix crypto test case for issue 40794Micah Elizabeth Scott
This is an additional test case for test_sandbox that runs a small subset of test_crypto_equix() inside the syscall sandbox, where mprotect() is filtered. It's reasonable for the sandbox to disallow JIT. We could revise this policy if we want, but it seems a good default for now. The problem in issue 40794 is that both equix and hashx need improvements in their API to handle failures after allocation time, and this failure occurs while the hash function is being compiled. With this commit only, the segfault from issue 40794 is reproduced. Subsequent commits will fix the segfault and revise the API. Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2022-06-13sandbox: Allow use with fragile hardening on AArch64 and elsewhereSimon South
Update the sandbox implementation to allow its use with fragile hardening enabled on AArch64 (ARM64) and other architectures that use Linux's generic syscall interface. Note that in this configuration the sandbox is completely unable to filter requests to open files and directories. Update the sandbox unit tests to match.
2021-11-05sandbox: Allow "statx" syscall on i386 for glibc 2.33Simon South
glibc versions 2.33 and newer use the modern "statx" system call in their implementations of stat() and opendir() for Linux on i386. Prevent failures in the sandbox unit tests by modifying the sandbox to allow this system call without restriction on i386 when it is available, and update the test suite to skip the "sandbox/stat_filename" test in this case as it is certain to fail.
2021-11-05test: Skip sandbox/stat_filename where "stat64" syscall definedSimon South
On 32-bit architectures where Linux provides the "stat64" system call, including i386, the sandbox is unable to filter calls to stat() as glibc uses this system call itself internally and the sandbox must allow it without restriction. Update the sandbox unit tests to skip the "sandbox/stat_filename" test on systems where the "stat64" system call is defined and the test is certain to fail. Also reorder the "#if" statement's clauses to correspond with the comment preceding it, for clarity.
2021-09-28test: Add sandbox unit testsSimon South