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:
Pierre Bourdon 2022-04-30 11:52:59 +02:00
parent 4259bc36af
commit 531275b0f3
No known key found for this signature in database
GPG key ID: 6FB80DCD84DA0F1C

View file

@ -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,