x86/uapi: fix SHADOW_STACK_SET_TOKEN type
PATCH 1/1 x86/uapi: fix SHADOW_STACK_SET_TOKEN type
Fix the type of SHADOW_STACK_SET_TOKEN to match the type of the corresponding "flags" argument of map_shadow_stack syscall which is of type "unsigned int".
--- arch/x86/include/uapi/asm/mman.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/uapi/asm/mman.h +1 -1
@@ -6,7 +6,7 @@#define MAP_ABOVE4G 0x80/* only map above 4GB */ /* Flags for map_shadow_stack(2) */ -#define SHADOW_STACK_SET_TOKEN (1ULL << 0)/* Set up a restore token in the shadow stack */ +#define SHADOW_STACK_SET_TOKEN (1U << 0)/* Set up a restore token in the shadow stack */ #include <asm-generic/mman.h>
Signature · 1 line
ldv
Quoted 18 lines · Dmitry V. Levin
Fix the type of
SHADOW_STACK_SET_TOKENto match the type of the corresponding "flags" argument ofmap_shadow_stacksyscall which is of type "unsigned int".Fixes c35559f94ebc3 ("x86/shstk: Introduce map_shadow_stacksyscall")
Signed-off-by Dmitry V. Levin <[email protected]>---
arch/x86/include/uapi/asm/mman.h | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/include/uapi/asm/mman.h +0
-0@@ -6,7 +6,7 @@ #define MAP_ABOVE4G 0x80 /* only map above 4GB */
Quoted 8 lines
/* Flags formap_shadow_stack(2)*/
-#define SHADOW_STACK_SET_TOKEN (1ULL << 0) /* Set up a restore token in the shadow stack */
+#define SHADOW_STACK_SET_TOKEN (1U << 0) /* Set up a restore token in the shadow stack */
#include <asm-generic/mman.h>
Good point that they are mismatched. I don't remember why flags is not an unsigned long though. I wonder if we should quick change it to an unsigned long, if it's not too late. We probably won't run out of flags, but maybe some value could get stuffed in the upper bits or something someday.
Quoted 25 lines · Rick P
Quoted 24 lines · Dmitry V. Levin
Fix the type of
SHADOW_STACK_SET_TOKENto match the type of the corresponding "flags" argument ofmap_shadow_stacksyscall which is of type "unsigned int".Fixes c35559f94ebc3 ("x86/shstk: Introduce map_shadow_stacksyscall")
Signed-off-by Dmitry V. Levin <[email protected]>---
arch/x86/include/uapi/asm/mman.h | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/include/uapi/asm/mman.h +0
-0@@ -6,7 +6,7 @@ #define MAP_ABOVE4G 0x80 /* only map above 4GB */
/* Flags formap_shadow_stack(2)*/
-#define SHADOW_STACK_SET_TOKEN (1ULL << 0) /* Set up a restore token in the shadow stack */
+#define SHADOW_STACK_SET_TOKEN (1U << 0) /* Set up a restore token in the shadow stack */
Quoted 8 lines
Quoted 2 lines
#include <asm-generic/mman.h>Good point that they are mismatched. I don't remember why flags is not an unsigned long though. I wonder if we should quick change it to an unsigned long, if it's not too late. We probably won't run out of flags, but maybe some value could get stuffed in the upper bits or something someday.
We usually don't use unsigned long for flags because we support 32-bit architectures.
Signature · 1 line
ldv