Skip to content

Commit 19e4147

Browse files
committed
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: "Misc fixes: - EFI boot fix for signed kernels - an AC flags fix related to UBSAN - Hyper-V infinite loop fix" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/hyper-v: Fix overflow bug in fill_gva_list() x86/uaccess: Don't leak the AC flags into __get_user() argument evaluation x86/boot: Preserve boot_params.secure_boot from sanitizing
2 parents 262f7ee + 4030b4c commit 19e4147

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

arch/x86/hyperv/mmu.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ static inline int fill_gva_list(u64 gva_list[], int offset,
3737
* Lower 12 bits encode the number of additional
3838
* pages to flush (in addition to the 'cur' page).
3939
*/
40-
if (diff >= HV_TLB_FLUSH_UNIT)
40+
if (diff >= HV_TLB_FLUSH_UNIT) {
4141
gva_list[gva_n] |= ~PAGE_MASK;
42-
else if (diff)
42+
cur += HV_TLB_FLUSH_UNIT;
43+
} else if (diff) {
4344
gva_list[gva_n] |= (diff - 1) >> PAGE_SHIFT;
45+
cur = end;
46+
}
4447

45-
cur += HV_TLB_FLUSH_UNIT;
4648
gva_n++;
4749

4850
} while (cur < end);

arch/x86/include/asm/bootparam_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ static void sanitize_boot_params(struct boot_params *boot_params)
7070
BOOT_PARAM_PRESERVE(eddbuf_entries),
7171
BOOT_PARAM_PRESERVE(edd_mbr_sig_buf_entries),
7272
BOOT_PARAM_PRESERVE(edd_mbr_sig_buffer),
73+
BOOT_PARAM_PRESERVE(secure_boot),
7374
BOOT_PARAM_PRESERVE(hdr),
7475
BOOT_PARAM_PRESERVE(e820_table),
7576
BOOT_PARAM_PRESERVE(eddbuf),

arch/x86/include/asm/uaccess.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,10 @@ __pu_label: \
444444
({ \
445445
int __gu_err; \
446446
__inttype(*(ptr)) __gu_val; \
447+
__typeof__(ptr) __gu_ptr = (ptr); \
448+
__typeof__(size) __gu_size = (size); \
447449
__uaccess_begin_nospec(); \
448-
__get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT); \
450+
__get_user_size(__gu_val, __gu_ptr, __gu_size, __gu_err, -EFAULT); \
449451
__uaccess_end(); \
450452
(x) = (__force __typeof__(*(ptr)))__gu_val; \
451453
__builtin_expect(__gu_err, 0); \

0 commit comments

Comments
 (0)