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) +#else #define COMPAT_RLIM_INFINITY 0xffffffff +#endif
#define COMPAT_OFF_T_MAX 0x7fffffff
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
On 22/12/2022 08:24, Kevin Brodsky wrote:
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!
Thanks for looking into it, sent a v2 with those as well. Will take a closer look at the whole file after the holidays if it's still needed.
It took a bit longer to send than desired as I discovered a few new LTP failures in compat that I needed to confirm (sadly, not halfway there anymore !), but they are not linked to this change.
Thanks, Téo
Kevin
+#else #define COMPAT_RLIM_INFINITY 0xffffffff +#endif #define COMPAT_OFF_T_MAX 0x7fffffff
linux-morello@op-lists.linaro.org