1. 11 2月, 2009 1 次提交
    • T
      x86: fix x86_32 stack protector bugs · 5c79d2a5
      Tejun Heo 提交于
      Impact: fix x86_32 stack protector
      
      Brian Gerst found out that %gs was being initialized to stack_canary
      instead of stack_canary - 20, which basically gave the same canary
      value for all threads.  Fixing this also exposed the following bugs.
      
      * cpu_idle() didn't call boot_init_stack_canary()
      
      * stack canary switching in switch_to() was being done too late making
        the initial run of a new thread use the old stack canary value.
      
      Fix all of them and while at it update comment in cpu_idle() about
      calling boot_init_stack_canary().
      Reported-by: NBrian Gerst <brgerst@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5c79d2a5
  2. 10 2月, 2009 11 次提交
    • T
      x86: implement x86_32 stack protector · 60a5317f
      Tejun Heo 提交于
      Impact: stack protector for x86_32
      
      Implement stack protector for x86_32.  GDT entry 28 is used for it.
      It's set to point to stack_canary-20 and have the length of 24 bytes.
      CONFIG_CC_STACKPROTECTOR turns off CONFIG_X86_32_LAZY_GS and sets %gs
      to the stack canary segment on entry.  As %gs is otherwise unused by
      the kernel, the canary can be anywhere.  It's defined as a percpu
      variable.
      
      x86_32 exception handlers take register frame on stack directly as
      struct pt_regs.  With -fstack-protector turned on, gcc copies the
      whole structure after the stack canary and (of course) doesn't copy
      back on return thus losing all changed.  For now, -fno-stack-protector
      is added to all files which contain those functions.  We definitely
      need something better.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      60a5317f
    • T
      x86: make lazy %gs optional on x86_32 · ccbeed3a
      Tejun Heo 提交于
      Impact: pt_regs changed, lazy gs handling made optional, add slight
              overhead to SAVE_ALL, simplifies error_code path a bit
      
      On x86_32, %gs hasn't been used by kernel and handled lazily.  pt_regs
      doesn't have place for it and gs is saved/loaded only when necessary.
      In preparation for stack protector support, this patch makes lazy %gs
      handling optional by doing the followings.
      
      * Add CONFIG_X86_32_LAZY_GS and place for gs in pt_regs.
      
      * Save and restore %gs along with other registers in entry_32.S unless
        LAZY_GS.  Note that this unfortunately adds "pushl $0" on SAVE_ALL
        even when LAZY_GS.  However, it adds no overhead to common exit path
        and simplifies entry path with error code.
      
      * Define different user_gs accessors depending on LAZY_GS and add
        lazy_save_gs() and lazy_load_gs() which are noop if !LAZY_GS.  The
        lazy_*_gs() ops are used to save, load and clear %gs lazily.
      
      * Define ELF_CORE_COPY_KERNEL_REGS() which always read %gs directly.
      
      xen and lguest changes need to be verified.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ccbeed3a
    • T
      x86: add %gs accessors for x86_32 · d9a89a26
      Tejun Heo 提交于
      Impact: cleanup
      
      On x86_32, %gs is handled lazily.  It's not saved and restored on
      kernel entry/exit but only when necessary which usually is during task
      switch but there are few other places.  Currently, it's done by
      calling savesegment() and loadsegment() explicitly.  Define
      get_user_gs(), set_user_gs() and task_user_gs() and use them instead.
      
      While at it, clean up register access macros in signal.c.
      
      This cleans up code a bit and will help future changes.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d9a89a26
    • T
      x86: use asm .macro instead of cpp #define in entry_32.S · f0d96110
      Tejun Heo 提交于
      Impact: cleanup
      
      Use .macro instead of cpp #define where approriate.  This cleans up
      code and will ease future changes.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f0d96110
    • T
      x86: no stack protector for vdso · d627ded5
      Tejun Heo 提交于
      Impact: avoid crash on vsyscall
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d627ded5
    • T
      stackprotector: update make rules · 5d707e9c
      Tejun Heo 提交于
      Impact: no default -fno-stack-protector if stackp is enabled, cleanup
      
      Stackprotector make rules had the following problems.
      
      * cc support test and warning are scattered across makefile and
        kernel/panic.c.
      
      * -fno-stack-protector was always added regardless of configuration.
      
      Update such that cc support test and warning are contained in makefile
      and -fno-stack-protector is added iff stackp is turned off.  While at
      it, prepare for 32bit support.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5d707e9c
    • T
      x86: stackprotector.h misc update · 76397f72
      Tejun Heo 提交于
      Impact: misc udpate
      
      * wrap content with CONFIG_CC_STACK_PROTECTOR so that other arch files
        can include it directly
      
      * add missing includes
      
      This will help future changes.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      76397f72
    • T
      elf: add ELF_CORE_COPY_KERNEL_REGS() · 6cd61c0b
      Tejun Heo 提交于
      ELF core dump is used for both user land core dump and kernel crash
      dump.  Depending on architecture, register might need to be accessed
      differently for userland and kernel.  Allow architectures to define
      ELF_CORE_COPY_KERNEL_REGS() and use different operation for kernel
      register dump.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6cd61c0b
    • I
      Merge branch 'x86/urgent' into core/percpu · 92e2d508
      Ingo Molnar 提交于
      Conflicts:
      	arch/x86/kernel/acpi/boot.c
      92e2d508
    • I
      Merge branch 'x86/uaccess' into core/percpu · 5d96218b
      Ingo Molnar 提交于
      5d96218b
    • T
      x86: fix math_emu register frame access · d315760f
      Tejun Heo 提交于
      do_device_not_available() is the handler for #NM and it declares that
      it takes a unsigned long and calls math_emu(), which takes a long
      argument and surprisingly expects the stack frame starting at the zero
      argument would match struct math_emu_info, which isn't true regardless
      of configuration in the current code.
      
      This patch makes do_device_not_available() take struct pt_regs like
      other exception handlers and initialize struct math_emu_info with
      pointer to it and pass pointer to the math_emu_info to math_emulate()
      like normal C functions do.  This way, unless gcc makes a copy of
      struct pt_regs in do_device_not_available(), the register frame is
      correctly accessed regardless of kernel configuration or compiler
      used.
      
      This doesn't fix all math_emu problems but it at least gets it
      somewhat working.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d315760f
  3. 09 2月, 2009 19 次提交
  4. 08 2月, 2009 3 次提交
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 · e83102ca
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
        PCI PM: make the PM core more careful with drivers using the new PM framework
        PCI PM: Read power state from device after trying to change it on resume
        PCI PM: Do not disable and enable bridges during suspend-resume
        PCI: PCIe portdrv: Simplify suspend and resume
        PCI PM: Fix saving of device state in pci_legacy_suspend
        PCI PM: Check if the state has been saved before trying to restore it
        PCI PM: Fix handling of devices without drivers
        PCI: return error on failure to read PCI ROMs
        PCI: properly clean up ASPM link state on device remove
      e83102ca
    • R
      module: remove over-zealous check in __module_get() · 7f9a50a5
      Rusty Russell 提交于
      Impact: fix spurious BUG_ON() triggered under load
      
      module_refcount() isn't reliable outside stop_machine(), as demonstrated
      by Karsten Keil <kkeil@suse.de>, networking can trigger it under load
      (an inc on one cpu and dec on another while module_refcount() is tallying
       can give false results, for example).
      
      Almost noone should be using __module_get, but that's another issue.
      
      Cc: Karsten Keil <kkeil@suse.de>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7f9a50a5
    • L
      Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 · f12b12a8
      Linus Torvalds 提交于
      * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (30 commits)
        ACPI: Kconfig text - Fix the ACPI_CONTAINER module name according to the real module name.
        eeepc-laptop: fix oops when changing backlight brightness during eeepc-laptop init
        ACPICA: Fix table entry truncation calculation
        ACPI: Enable bit 11 in _PDC to advertise hw coord
        ACPI: struct device - replace bus_id with dev_name(), dev_set_name()
        ACPI: add missing KERN_* constants to printks
        ACPI: dock: Don't eval _STA on every show_docked sysfs read
        ACPI: disable ACPI cleanly when bad RSDP found
        ACPI: delete CPU_IDLE=n code
        ACPI: cpufreq: Remove deprecated /proc/acpi/processor/../performance proc entries
        ACPI: make some IO ports off-limits to AML
        ACPICA: add debug dump of BIOS _OSI strings
        ACPI: proc_dir_entry 'video/VGA' already registered
        ACPI: Skip the first two elements in the _BCL package
        ACPI: remove BM_RLD access from idle entry path
        ACPI: remove locking from PM1x_STS register reads
        eeepc-laptop: use netlink interface
        eeepc-laptop: Implement rfkill hotplugging in eeepc-laptop
        eeepc-laptop: Check return values from rfkill_register
        eeepc-laptop: Add support for extended hotkeys
        ...
      f12b12a8
  5. 07 2月, 2009 6 次提交