Skip to content

Commit 08a6b55

Browse files
committed
Merge tag 'x86-urgent-2024-06-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: - Fix the 8 bytes get_user() logic on x86-32 - Fix build bug that creates weird & mistaken target directory under arch/x86/ * tag 'x86-urgent-2024-06-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Don't add the EFI stub to targets, again x86/uaccess: Fix missed zeroing of ia32 u64 get_user() range checking
2 parents 41d7072 + b2747f1 commit 08a6b55

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

arch/x86/boot/compressed/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ vmlinux-objs-$(CONFIG_UNACCEPTED_MEMORY) += $(obj)/mem.o
105105

106106
vmlinux-objs-$(CONFIG_EFI) += $(obj)/efi.o
107107
vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_mixed.o
108-
vmlinux-objs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
108+
vmlinux-libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
109109

110-
$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
110+
$(obj)/vmlinux: $(vmlinux-objs-y) $(vmlinux-libs-y) FORCE
111111
$(call if_changed,ld)
112112

113113
OBJCOPYFLAGS_vmlinux.bin := -R .comment -S

arch/x86/include/asm/uaccess.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ extern int __get_user_bad(void);
7878
int __ret_gu; \
7979
register __inttype(*(ptr)) __val_gu asm("%"_ASM_DX); \
8080
__chk_user_ptr(ptr); \
81-
asm volatile("call __" #fn "_%c4" \
81+
asm volatile("call __" #fn "_%c[size]" \
8282
: "=a" (__ret_gu), "=r" (__val_gu), \
8383
ASM_CALL_CONSTRAINT \
84-
: "0" (ptr), "i" (sizeof(*(ptr)))); \
84+
: "0" (ptr), [size] "i" (sizeof(*(ptr)))); \
8585
instrument_get_user(__val_gu); \
8686
(x) = (__force __typeof__(*(ptr))) __val_gu; \
8787
__builtin_expect(__ret_gu, 0); \

arch/x86/lib/getuser.S

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@
4444
or %rdx, %rax
4545
.else
4646
cmp $TASK_SIZE_MAX-\size+1, %eax
47+
.if \size != 8
4748
jae .Lbad_get_user
49+
.else
50+
jae .Lbad_get_user_8
51+
.endif
4852
sbb %edx, %edx /* array_index_mask_nospec() */
4953
and %edx, %eax
5054
.endif
@@ -154,7 +158,7 @@ SYM_CODE_END(__get_user_handle_exception)
154158
#ifdef CONFIG_X86_32
155159
SYM_CODE_START_LOCAL(__get_user_8_handle_exception)
156160
ASM_CLAC
157-
bad_get_user_8:
161+
.Lbad_get_user_8:
158162
xor %edx,%edx
159163
xor %ecx,%ecx
160164
mov $(-EFAULT),%_ASM_AX

0 commit comments

Comments
 (0)