mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
sandbox: fix openat filtering on AArch64
New glibc versions not sign-extending 32 bit negative constants seems to not be a thing on AArch64. I suspect that this might not be the only architecture where the sign-extensions is happening, and the correct fix might be instead to use a proper 32 bit comparison for the first openat parameter. For now, band-aid fix this so the sandbox can work again on AArch64.
This commit is contained in:
parent
4259bc36af
commit
531275b0f3
1 changed files with 5 additions and 0 deletions
|
@ -518,7 +518,12 @@ libc_uses_openat_for_opendir(void)
|
|||
static int
|
||||
libc_negative_constant_needs_cast(void)
|
||||
{
|
||||
#if defined(__aarch64__) && defined(__LP64__)
|
||||
/* Existing glibc versions always sign-extend to 64 bits on AArch64. */
|
||||
return 0;
|
||||
#else
|
||||
return is_libc_at_least(2, 27);
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Allow a single file to be opened. If <b>use_openat</b> is true,
|
||||
|
|
Loading…
Add table
Reference in a new issue