Some compat defines are still using 32-bits values, update them to a 64-bits one (COMPAT_OFF_T_MAX) or use the native value in COMPAT64 (COMPAT_RLIM_INFINITY, COMPAT_MINSIGSTKSZ).
Signed-off-by: Teo Couprie Diaz teo.coupriediaz@arm.com --- arch/arm64/include/asm/compat.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 9c6112ae942b..9bf4cfb6ad60 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -15,6 +15,8 @@ typedef u16 compat_mode_t; /* * Architecture specific compatibility types */ +#include <asm/compat.h> +#include <linux/resource.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/sched/task_stack.h> @@ -100,9 +102,15 @@ struct compat_statfs { compat_long_t f_spare[4]; };
+#ifdef CONFIG_COMPAT64 +#define COMPAT_RLIM_INFINITY RLIM_INFINITY + +#define COMPAT_OFF_T_MAX LONG_MAX +#else #define COMPAT_RLIM_INFINITY 0xffffffff
#define COMPAT_OFF_T_MAX 0x7fffffff +#endif
static inline void __user *compat_ptr(compat_uptr_t uptr) { @@ -115,7 +123,12 @@ static inline void __user *compat_ptr(compat_uptr_t uptr) #define compat_ptr(uptr) compat_ptr(uptr)
#define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current))) + +#ifdef CONFIG_COMPAT64 +#define COMPAT_MINSIGSTKSZ MINSIGSTKSZ +#else #define COMPAT_MINSIGSTKSZ 2048 +#endif
#ifdef CONFIG_COMPAT64 #define COMPAT_USE_64BIT_TIME 1
On 10/01/2023 12:03, Teo Couprie Diaz wrote:
Some compat defines are still using 32-bits values, update them to a 64-bits one (COMPAT_OFF_T_MAX) or use the native value in COMPAT64 (COMPAT_RLIM_INFINITY, COMPAT_MINSIGSTKSZ).
Signed-off-by: Teo Couprie Diaz teo.coupriediaz@arm.com
arch/arm64/include/asm/compat.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 9c6112ae942b..9bf4cfb6ad60 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -15,6 +15,8 @@ typedef u16 compat_mode_t; /*
- Architecture specific compatibility types
*/ +#include <asm/compat.h>
Sorry clearly got distracted when I reviewed v2 - I meant <asm/signal.h>, otherwise you are including this file itself (which does nothing thanks to include guards) :)
Kevin
+#include <linux/resource.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/sched/task_stack.h> @@ -100,9 +102,15 @@ struct compat_statfs { compat_long_t f_spare[4]; }; +#ifdef CONFIG_COMPAT64 +#define COMPAT_RLIM_INFINITY RLIM_INFINITY
+#define COMPAT_OFF_T_MAX LONG_MAX +#else #define COMPAT_RLIM_INFINITY 0xffffffff #define COMPAT_OFF_T_MAX 0x7fffffff +#endif static inline void __user *compat_ptr(compat_uptr_t uptr) { @@ -115,7 +123,12 @@ static inline void __user *compat_ptr(compat_uptr_t uptr) #define compat_ptr(uptr) compat_ptr(uptr) #define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current)))
+#ifdef CONFIG_COMPAT64 +#define COMPAT_MINSIGSTKSZ MINSIGSTKSZ +#else #define COMPAT_MINSIGSTKSZ 2048 +#endif #ifdef CONFIG_COMPAT64 #define COMPAT_USE_64BIT_TIME 1
On 12/01/2023 10:11, Kevin Brodsky wrote:
On 10/01/2023 12:03, Teo Couprie Diaz wrote:
Some compat defines are still using 32-bits values, update them to a 64-bits one (COMPAT_OFF_T_MAX) or use the native value in COMPAT64 (COMPAT_RLIM_INFINITY, COMPAT_MINSIGSTKSZ).
Signed-off-by: Teo Couprie Diaz teo.coupriediaz@arm.com
arch/arm64/include/asm/compat.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 9c6112ae942b..9bf4cfb6ad60 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -15,6 +15,8 @@ typedef u16 compat_mode_t; /*
- Architecture specific compatibility types
*/ +#include <asm/compat.h>
Sorry clearly got distracted when I reviewed v2 - I meant <asm/signal.h>, otherwise you are including this file itself (which does nothing thanks to include guards) :)
Ah, right ! And I must have been on autopilot as well as it didn't register for me either !
Sending a v4 with the fix.
Téo
Kevin
+#include <linux/resource.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/sched/task_stack.h> @@ -100,9 +102,15 @@ struct compat_statfs { compat_long_t f_spare[4]; }; +#ifdef CONFIG_COMPAT64 +#define COMPAT_RLIM_INFINITY RLIM_INFINITY
+#define COMPAT_OFF_T_MAX LONG_MAX +#else #define COMPAT_RLIM_INFINITY 0xffffffff #define COMPAT_OFF_T_MAX 0x7fffffff +#endif static inline void __user *compat_ptr(compat_uptr_t uptr) { @@ -115,7 +123,12 @@ static inline void __user *compat_ptr(compat_uptr_t uptr) #define compat_ptr(uptr) compat_ptr(uptr) #define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current)))
+#ifdef CONFIG_COMPAT64 +#define COMPAT_MINSIGSTKSZ MINSIGSTKSZ +#else #define COMPAT_MINSIGSTKSZ 2048 +#endif #ifdef CONFIG_COMPAT64 #define COMPAT_USE_64BIT_TIME 1
linux-morello@op-lists.linaro.org