Commit efcd9e0b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-fixes-for-linus' of...

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

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Make EFI RTC function depend on 32bit again
  x86-64: Fix register leak in 32-bit syscall audting
  x86: crash_dump: Fix non-pae kdump kernel memory accesses
  x86: Side-step lguest problem by only building cmpxchg8b_emu for pre-Pentium
  x86: Remove STACKPROTECTOR_ALL
parents 32c5fc10 772be899
...@@ -1443,12 +1443,8 @@ config SECCOMP ...@@ -1443,12 +1443,8 @@ config SECCOMP
If unsure, say Y. Only embedded should say N here. If unsure, say Y. Only embedded should say N here.
config CC_STACKPROTECTOR_ALL
bool
config CC_STACKPROTECTOR config CC_STACKPROTECTOR
bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
select CC_STACKPROTECTOR_ALL
---help--- ---help---
This option turns on the -fstack-protector GCC feature. This This option turns on the -fstack-protector GCC feature. This
feature puts, at the beginning of functions, a canary value on feature puts, at the beginning of functions, a canary value on
......
...@@ -400,7 +400,7 @@ config X86_TSC ...@@ -400,7 +400,7 @@ config X86_TSC
config X86_CMPXCHG64 config X86_CMPXCHG64
def_bool y def_bool y
depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM depends on !M386 && !M486
# this should be set for all -march=.. options where the compiler # this should be set for all -march=.. options where the compiler
# generates cmov. # generates cmov.
......
...@@ -76,7 +76,6 @@ ifdef CONFIG_CC_STACKPROTECTOR ...@@ -76,7 +76,6 @@ ifdef CONFIG_CC_STACKPROTECTOR
cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh
ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(biarch)),y) ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(biarch)),y)
stackp-y := -fstack-protector stackp-y := -fstack-protector
stackp-$(CONFIG_CC_STACKPROTECTOR_ALL) += -fstack-protector-all
KBUILD_CFLAGS += $(stackp-y) KBUILD_CFLAGS += $(stackp-y)
else else
$(warning stack protector enabled but no compiler support) $(warning stack protector enabled but no compiler support)
......
...@@ -204,7 +204,7 @@ sysexit_from_sys_call: ...@@ -204,7 +204,7 @@ sysexit_from_sys_call:
movl RDI-ARGOFFSET(%rsp),%r8d /* reload 5th syscall arg */ movl RDI-ARGOFFSET(%rsp),%r8d /* reload 5th syscall arg */
.endm .endm
.macro auditsys_exit exit,ebpsave=RBP .macro auditsys_exit exit
testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
jnz ia32_ret_from_sys_call jnz ia32_ret_from_sys_call
TRACE_IRQS_ON TRACE_IRQS_ON
...@@ -217,7 +217,6 @@ sysexit_from_sys_call: ...@@ -217,7 +217,6 @@ sysexit_from_sys_call:
call audit_syscall_exit call audit_syscall_exit
GET_THREAD_INFO(%r10) GET_THREAD_INFO(%r10)
movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */ movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */
movl \ebpsave-ARGOFFSET(%rsp),%ebp /* reload user register value */
movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
cli cli
TRACE_IRQS_OFF TRACE_IRQS_OFF
...@@ -351,7 +350,7 @@ cstar_auditsys: ...@@ -351,7 +350,7 @@ cstar_auditsys:
jmp cstar_dispatch jmp cstar_dispatch
sysretl_audit: sysretl_audit:
auditsys_exit sysretl_from_sys_call, RCX /* user %ebp in RCX slot */ auditsys_exit sysretl_from_sys_call
#endif #endif
cstar_tracesys: cstar_tracesys:
......
...@@ -16,6 +16,22 @@ static void *kdump_buf_page; ...@@ -16,6 +16,22 @@ static void *kdump_buf_page;
/* Stores the physical address of elf header of crash image. */ /* Stores the physical address of elf header of crash image. */
unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX; unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
static inline bool is_crashed_pfn_valid(unsigned long pfn)
{
#ifndef CONFIG_X86_PAE
/*
* non-PAE kdump kernel executed from a PAE one will crop high pte
* bits and poke unwanted space counting again from address 0, we
* don't want that. pte must fit into unsigned long. In fact the
* test checks high 12 bits for being zero (pfn will be shifted left
* by PAGE_SHIFT).
*/
return pte_pfn(pfn_pte(pfn, __pgprot(0))) == pfn;
#else
return true;
#endif
}
/** /**
* copy_oldmem_page - copy one page from "oldmem" * copy_oldmem_page - copy one page from "oldmem"
* @pfn: page frame number to be copied * @pfn: page frame number to be copied
...@@ -41,6 +57,9 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, ...@@ -41,6 +57,9 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
if (!csize) if (!csize)
return 0; return 0;
if (!is_crashed_pfn_valid(pfn))
return -EFAULT;
vaddr = kmap_atomic_pfn(pfn, KM_PTE0); vaddr = kmap_atomic_pfn(pfn, KM_PTE0);
if (!userbuf) { if (!userbuf) {
......
...@@ -454,8 +454,10 @@ void __init efi_init(void) ...@@ -454,8 +454,10 @@ void __init efi_init(void)
if (add_efi_memmap) if (add_efi_memmap)
do_add_efi_memmap(); do_add_efi_memmap();
#ifdef CONFIG_X86_32
x86_platform.get_wallclock = efi_get_time; x86_platform.get_wallclock = efi_get_time;
x86_platform.set_wallclock = efi_set_rtc_mmss; x86_platform.set_wallclock = efi_set_rtc_mmss;
#endif
/* Setup for EFI runtime service */ /* Setup for EFI runtime service */
reboot_type = BOOT_EFI; reboot_type = BOOT_EFI;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment