Skip to content

Commit

Permalink
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/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
  • Loading branch information
Linus Torvalds committed Nov 2, 2009
2 parents 32c5fc1 + 772be89 commit efcd9e0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
4 changes: 0 additions & 4 deletions arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1443,12 +1443,8 @@ config SECCOMP

If unsure, say Y. Only embedded should say N here.

config CC_STACKPROTECTOR_ALL
bool

config CC_STACKPROTECTOR
bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
select CC_STACKPROTECTOR_ALL
---help---
This option turns on the -fstack-protector GCC feature. This
feature puts, at the beginning of functions, a canary value on
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/Kconfig.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ config X86_TSC

config X86_CMPXCHG64
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
# generates cmov.
Expand Down
1 change: 0 additions & 1 deletion arch/x86/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ ifdef CONFIG_CC_STACKPROTECTOR
cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh
ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(biarch)),y)
stackp-y := -fstack-protector
stackp-$(CONFIG_CC_STACKPROTECTOR_ALL) += -fstack-protector-all
KBUILD_CFLAGS += $(stackp-y)
else
$(warning stack protector enabled but no compiler support)
Expand Down
5 changes: 2 additions & 3 deletions arch/x86/ia32/ia32entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ sysexit_from_sys_call:
movl RDI-ARGOFFSET(%rsp),%r8d /* reload 5th syscall arg */
.endm

.macro auditsys_exit exit,ebpsave=RBP
.macro auditsys_exit exit
testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
jnz ia32_ret_from_sys_call
TRACE_IRQS_ON
Expand All @@ -217,7 +217,6 @@ sysexit_from_sys_call:
call audit_syscall_exit
GET_THREAD_INFO(%r10)
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
cli
TRACE_IRQS_OFF
Expand Down Expand Up @@ -351,7 +350,7 @@ cstar_auditsys:
jmp cstar_dispatch

sysretl_audit:
auditsys_exit sysretl_from_sys_call, RCX /* user %ebp in RCX slot */
auditsys_exit sysretl_from_sys_call
#endif

cstar_tracesys:
Expand Down
19 changes: 19 additions & 0 deletions arch/x86/kernel/crash_dump_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ static void *kdump_buf_page;
/* Stores the physical address of elf header of crash image. */
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"
* @pfn: page frame number to be copied
Expand All @@ -41,6 +57,9 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
if (!csize)
return 0;

if (!is_crashed_pfn_valid(pfn))
return -EFAULT;

vaddr = kmap_atomic_pfn(pfn, KM_PTE0);

if (!userbuf) {
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,10 @@ void __init efi_init(void)
if (add_efi_memmap)
do_add_efi_memmap();

#ifdef CONFIG_X86_32
x86_platform.get_wallclock = efi_get_time;
x86_platform.set_wallclock = efi_set_rtc_mmss;
#endif

/* Setup for EFI runtime service */
reboot_type = BOOT_EFI;
Expand Down

0 comments on commit efcd9e0

Please sign in to comment.