On 21/12/2022 18:22, Teo Couprie Diaz wrote:
For arm64, COMPAT_RLIM_INFINITY was explicitly defined as a 0xffffffff, which is 32-bits. This was fine when COMPAT was only 32-bits, but is too restrictive for COMPAT64.
Add a new define in COMPAT64 which uses the same define as the regular RLIM_INFINITY in asm-generic/resrouce.h, based on an unsigned long.
Signed-off-by: Teo Couprie Diaz teo.coupriediaz@arm.com
arch/arm64/include/asm/compat.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 9c6112ae942b..f5ebdd9600a5 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -100,7 +100,11 @@ struct compat_statfs { compat_long_t f_spare[4]; }; +#ifdef CONFIG_COMPAT64 +#define COMPAT_RLIM_INFINITY (~0UL)
Good catch! That should fix quite a few LTP tests indeed.
Could we define it directly to RLIM_INFINITY instead of hardcoding?
That patch made me realise we should have another look at this header, as it's not the only thing that's specific to compat32 in there. It would be good to check the rest of the macros, from a quick glance I think the following also need to be brought in line with the native values: * COMPAT_OFF_T_MAX * COMPAT_MINSIGSTKSZ
Thanks!
Kevin
+#else #define COMPAT_RLIM_INFINITY 0xffffffff +#endif #define COMPAT_OFF_T_MAX 0x7fffffff