Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:

- Expand the space for uncompressing as the LZ4 worst case does not fit
into the currently reserved space

- Validate boot parameters more strictly to prevent out of bound access
in the decompressor/boot code

- Fix off by one errors in get_segment_base()

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/boot: Prevent faulty bootparams.screeninfo from causing harm
x86/boot: Provide more slack space during decompression
x86/ldt: Fix off by one in get_segment_base()

Changed files
+10 -8
arch
x86
boot
compressed
events
+1 -2
arch/x86/boot/compressed/misc.c
··· 116 116 } 117 117 } 118 118 119 - if (boot_params->screen_info.orig_video_mode == 0 && 120 - lines == 0 && cols == 0) 119 + if (lines == 0 || cols == 0) 121 120 return; 122 121 123 122 x = boot_params->screen_info.orig_x;
+7 -1
arch/x86/boot/header.S
··· 520 520 # the description in lib/decompressor_xxx.c for specific information. 521 521 # 522 522 # extra_bytes = (uncompressed_size >> 12) + 65536 + 128 523 + # 524 + # LZ4 is even worse: data that cannot be further compressed grows by 0.4%, 525 + # or one byte per 256 bytes. OTOH, we can safely get rid of the +128 as 526 + # the size-dependent part now grows so fast. 527 + # 528 + # extra_bytes = (uncompressed_size >> 8) + 65536 523 529 524 - #define ZO_z_extra_bytes ((ZO_z_output_len >> 12) + 65536 + 128) 530 + #define ZO_z_extra_bytes ((ZO_z_output_len >> 8) + 65536) 525 531 #if ZO_z_output_len > ZO_z_input_len 526 532 # define ZO_z_extract_offset (ZO_z_output_len + ZO_z_extra_bytes - \ 527 533 ZO_z_input_len)
+2 -5
arch/x86/events/core.c
··· 2335 2335 #ifdef CONFIG_MODIFY_LDT_SYSCALL 2336 2336 struct ldt_struct *ldt; 2337 2337 2338 - if (idx > LDT_ENTRIES) 2339 - return 0; 2340 - 2341 2338 /* IRQs are off, so this synchronizes with smp_store_release */ 2342 2339 ldt = lockless_dereference(current->active_mm->context.ldt); 2343 - if (!ldt || idx > ldt->nr_entries) 2340 + if (!ldt || idx >= ldt->nr_entries) 2344 2341 return 0; 2345 2342 2346 2343 desc = &ldt->entries[idx]; ··· 2345 2348 return 0; 2346 2349 #endif 2347 2350 } else { 2348 - if (idx > GDT_ENTRIES) 2351 + if (idx >= GDT_ENTRIES) 2349 2352 return 0; 2350 2353 2351 2354 desc = raw_cpu_ptr(gdt_page.gdt) + idx;