Skip to content

Commit 7a00829

Browse files
jpoimboePeter Zijlstra
authored andcommitted
x86/uaccess: Add ENDBR to __put_user_nocheck*()
The __put_user_nocheck*() inner labels are exported, so in keeping with the "allow exported functions to be indirectly called" policy, add ENDBR. Fixes: ed53a0d ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls") Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/207f02177a23031091d1a608de6049a9e5e8ff80.1650300597.git.jpoimboe@redhat.com
1 parent 1c0513d commit 7a00829

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/lib/putuser.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ SYM_FUNC_START(__put_user_1)
4848
cmp %_ASM_BX,%_ASM_CX
4949
jae .Lbad_put_user
5050
SYM_INNER_LABEL(__put_user_nocheck_1, SYM_L_GLOBAL)
51+
ENDBR
5152
ASM_STAC
5253
1: movb %al,(%_ASM_CX)
5354
xor %ecx,%ecx
@@ -62,6 +63,7 @@ SYM_FUNC_START(__put_user_2)
6263
cmp %_ASM_BX,%_ASM_CX
6364
jae .Lbad_put_user
6465
SYM_INNER_LABEL(__put_user_nocheck_2, SYM_L_GLOBAL)
66+
ENDBR
6567
ASM_STAC
6668
2: movw %ax,(%_ASM_CX)
6769
xor %ecx,%ecx
@@ -76,6 +78,7 @@ SYM_FUNC_START(__put_user_4)
7678
cmp %_ASM_BX,%_ASM_CX
7779
jae .Lbad_put_user
7880
SYM_INNER_LABEL(__put_user_nocheck_4, SYM_L_GLOBAL)
81+
ENDBR
7982
ASM_STAC
8083
3: movl %eax,(%_ASM_CX)
8184
xor %ecx,%ecx
@@ -90,6 +93,7 @@ SYM_FUNC_START(__put_user_8)
9093
cmp %_ASM_BX,%_ASM_CX
9194
jae .Lbad_put_user
9295
SYM_INNER_LABEL(__put_user_nocheck_8, SYM_L_GLOBAL)
96+
ENDBR
9397
ASM_STAC
9498
4: mov %_ASM_AX,(%_ASM_CX)
9599
#ifdef CONFIG_X86_32

0 commit comments

Comments
 (0)