1. 14 12月, 2012 3 次提交
    • R
      powerpc: add finit_module syscall. · 71eac702
      Rusty Russell 提交于
      (This is just for Acks: this won't work without the actual syscall patches,
       sitting in my tree for -next at the moment).
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      71eac702
    • K
      ARM: add finit_module syscall to ARM · 4926f652
      Kees Cook 提交于
      Add finit_module syscall to the ARM syscall list.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      4926f652
    • K
      module: add syscall to load module from fd · 34e1169d
      Kees Cook 提交于
      As part of the effort to create a stronger boundary between root and
      kernel, Chrome OS wants to be able to enforce that kernel modules are
      being loaded only from our read-only crypto-hash verified (dm_verity)
      root filesystem. Since the init_module syscall hands the kernel a module
      as a memory blob, no reasoning about the origin of the blob can be made.
      
      Earlier proposals for appending signatures to kernel modules would not be
      useful in Chrome OS, since it would involve adding an additional set of
      keys to our kernel and builds for no good reason: we already trust the
      contents of our root filesystem. We don't need to verify those kernel
      modules a second time. Having to do signature checking on module loading
      would slow us down and be redundant. All we need to know is where a
      module is coming from so we can say yes/no to loading it.
      
      If a file descriptor is used as the source of a kernel module, many more
      things can be reasoned about. In Chrome OS's case, we could enforce that
      the module lives on the filesystem we expect it to live on.  In the case
      of IMA (or other LSMs), it would be possible, for example, to examine
      extended attributes that may contain signatures over the contents of
      the module.
      
      This introduces a new syscall (on x86), similar to init_module, that has
      only two arguments. The first argument is used as a file descriptor to
      the module and the second argument is a pointer to the NULL terminated
      string of module arguments.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (merge fixes)
      34e1169d
  2. 01 12月, 2012 1 次提交
    • V
      x86, fpu: Avoid FPU lazy restore after suspend · 644c1541
      Vincent Palatin 提交于
      When a cpu enters S3 state, the FPU state is lost.
      After resuming for S3, if we try to lazy restore the FPU for a process running
      on the same CPU, this will result in a corrupted FPU context.
      
      Ensure that "fpu_owner_task" is properly invalided when (re-)initializing a CPU,
      so nobody will try to lazy restore a state which doesn't exist in the hardware.
      
      Tested with a 64-bit kernel on a 4-core Ivybridge CPU with eagerfpu=off,
      by doing thousands of suspend/resume cycles with 4 processes doing FPU
      operations running. Without the patch, a process is killed after a
      few hundreds cycles by a SIGFPE.
      
      Cc: Duncan Laurie <dlaurie@chromium.org>
      Cc: Olof Johansson <olofj@chromium.org>
      Cc: <stable@kernel.org> v3.4+ # for 3.4 need to replace this_cpu_write by percpu_write
      Signed-off-by: NVincent Palatin <vpalatin@chromium.org>
      Link: http://lkml.kernel.org/r/1354306532-1014-1-git-send-email-vpalatin@chromium.orgSigned-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      644c1541
  3. 29 11月, 2012 7 次提交
  4. 28 11月, 2012 2 次提交
    • W
      ARM: 7586/1: sp804: set cpumask to cpu_possible_mask for clock event device · ea3aacf5
      Will Deacon 提交于
      The SP804 driver statically initialises the cpumask of the clock event
      device to be cpu_all_mask, which is derived from the compile-time
      constant NR_CPUS. This breaks SMP_ON_UP systems where the interrupt
      controller handling the sp804 doesn't have the irq_set_affinity callback
      on the irq_chip, because the common timer code fails to identify the
      device as cpu-local and ends up treating it as a broadcast device
      instead.
      
      This patch fixes the problem by using cpu_possible_mask at runtime,
      which will correctly represent the possible CPUs when SMP_ON_UP is being
      used.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      ea3aacf5
    • H
      x86-32: Unbreak booting on some 486 clones · 6662c34f
      H. Peter Anvin 提交于
      There appear to have been some 486 clones, including the "enhanced"
      version of Am486, which have CPUID but not CR4.  These 486 clones had
      only the FPU flag, if any, unlike the Intel 486s with CPUID, which
      also had VME and therefore needed CR4.
      
      Therefore, look at the basic CPUID flags and require at least one bit
      other than bit 0 before we modify CR4.
      
      Thanks to Christian Ludloff of sandpile.org for confirming this as a
      problem.
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      6662c34f
  5. 27 11月, 2012 3 次提交
    • H
      x86, kvm: Remove incorrect redundant assembly constraint · cb7cb286
      H. Peter Anvin 提交于
      In __emulate_1op_rax_rdx, we use "+a" and "+d" which are input/output
      constraints, and *then* use "a" and "d" as input constraints.  This is
      incorrect, but happens to work on some versions of gcc.
      
      However, it breaks gcc with -O0 and icc, and may break on future
      versions of gcc.
      Reported-and-tested-by: NMelanie Blower <melanie.blower@intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      Link: http://lkml.kernel.org/r/B3584E72CFEBED439A3ECA9BCE67A4EF1B17AF90@FMSMSX107.amr.corp.intel.comReviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Acked-by: NMarcelo Tosatti <mtosatti@redhat.com>
      cb7cb286
    • M
      c6x: fix misleading comment · 9c0603f4
      Mark Salter 提交于
      A comment in entry.S incorrectly stated that interrupt vectors
      called __do_IRQ() and that int6 vector was used for syscalls.
      Both statements are incorrect for the current kernel, so this
      patch cleans up the wording to reflect current reality.
      Signed-off-by: NMark Salter <msalter@redhat.com>
      9c0603f4
    • M
      c6x: run do_notify_resume with interrupts enabled · 9d34340e
      Mark Salter 提交于
      C6x was mistakenly running do_notify_resume with interrupts disabled.
      This would triggerlead to a warning in local_bh_enable() because interrupts
      were disabled:
      
      ------------[ cut here ]------------
      WARNING: at /es/linux/linux-next/kernel/softirq.c:160 local_bh_enable+0x5c/0x10c()
      Modules linked in:
      
                   e02f384d e002cda8 e02f3469 e02f384d 000000a0 e00363fc e01cce58 e5005c00
                   e0327986 00000000 e63c0aec 00000164 e00363fc 00000000 fffffffe e5005c00
                   e61fde00 e0268184 00000134 e01c91dc 00000001 fffffffe 00000000 10000100
                   e01c80e4 e5005c00 00000000 00000000 00000000 e63c0aec e526ce00 10000100
                   e628f920 e63c0a88 e6010410 e6449750 e5005c20 00000000 00000000 e63c0a80
                   e5005c20 e01c8590 e63c0a80 e5005c20 e63c0aec e00a0554 e009c758 e639e860
       irq_spurious_proc_fops+0x6ad/0x3438
       warn_slowpath_common+0x8c/0xb8
       irq_spurious_proc_fops+0x2c9/0x3438
       irq_spurious_proc_fops+0x6ad/0x3438
       local_bh_enable+0x5c/0x10c
       sk_alloc+0x34/0xa4
       local_bh_enable+0x5c/0x10c
       unix_release_sock+0x5c/0x2a0
       sys_connect+0x94/0xd4
       sock_release+0x38/0x104
       sock_close+0x3c/0x54
       __fput+0x154/0x2ec
       filp_close+0xc0/0xe4
       task_work_run+0xdc/0x12c
       sys_close+0x2c/0x74
       resume_userspace+0x0/0x30
      ---[ end trace a70cbd610ae1f6b4 ]---
      
      This patch enables interrupts before calling do_notify_resume().
      Signed-off-by: NMark Salter <msalter@redhat.com>
      9d34340e
  6. 26 11月, 2012 1 次提交
  7. 24 11月, 2012 3 次提交
  8. 23 11月, 2012 2 次提交
  9. 22 11月, 2012 12 次提交
    • A
      [PARISC] fix user-triggerable panic on parisc · 441a179d
      Al Viro 提交于
      int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, compat_sigset_t __user *oset,
                                          unsigned int sigsetsize)
      {
              sigset_t old_set, new_set;
              int ret;
      
              if (set && get_sigset32(set, &new_set, sigsetsize))
      
      ...
      static int
      get_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
      {
              compat_sigset_t s;
              int r;
      
              if (sz != sizeof *set) panic("put_sigset32()");
      
      In other words, rt_sigprocmask(69, (void *)69, 69) done by 32bit process
      will promptly panic the box.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      441a179d
    • A
      IXP4xx: use __iomem for MMIO · 0d2c9f05
      Arnd Bergmann 提交于
      The ixp4xx queue manager uses "const struct qmgr_regs __iomem *" as the
      type for a pointer that is passed to __raw_writel, which is not
      allowed because of the const-ness.
      
      Dropping the 'const' keyword fixes the problem. While we're here,
      let's also drop the useless type cast.
      
      Without this patch, building ixp4xx_defconfig results in:
      
      In file included from arch/arm/mach-ixp4xx/ixp4xx_qmgr.c:15:0:
      arch/arm/mach-ixp4xx/include/mach/qmgr.h: In function 'qmgr_put_entry':
      arch/arm/mach-ixp4xx/include/mach/qmgr.h:96:2: warning: passing argument 2 of '__raw_writel' discards 'const' qualifier from pointer target type [enabled by default]
      arch/arm/include/asm/io.h:88:91: note: expected 'volatile void *' but argument is of type 'const u32 *'
      In file included from drivers/net/ethernet/xscale/ixp4xx_eth.c:41:0:
      arch/arm/mach-ixp4xx/include/mach/qmgr.h: In function 'qmgr_put_entry':
      arch/arm/mach-ixp4xx/include/mach/qmgr.h:96:2: warning: passing argument 2 of '__raw_writel' discards 'const' qualifier from pointer target type [enabled by default]
      arch/arm/include/asm/io.h:88:91: note: expected 'volatile void *' but argument is of type 'const u32 *'
      arch/arm/mach-ixp4xx/ixp4xx_qmgr.c: In function 'qmgr_set_irq':
      arch/arm/mach-ixp4xx/ixp4xx_qmgr.c:41:9: warning: passing argument 2 of '__raw_writel' discards 'const' qualifier from pointer target type [enabled by default]
      arch/arm/include/asm/io.h:88:91: note: expected 'volatile void *' but argument is of type 'const u32 *'
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NKrzysztof Hałasa <khc@pm.waw.pl>
      0d2c9f05
    • K
      b7b23db7
    • K
      IXP4xx: Always ioremap() Queue Manager MMIO region at boot. · f0cdb153
      Krzysztof Hałasa 提交于
      It doesn't make much sense to map QMgr dynamically - we almost always need it
      and the static mapping will be needed for little-endian data-coherent operation
      (to make QMgr region value-coherent).
      Signed-off-by: NKrzysztof Hałasa <khc@pm.waw.pl>
      f0cdb153
    • T
      ixp4xx: Declare MODULE_FIRMWARE usage · 05cd3db0
      Tim Gardner 提交于
      Cc: Krzysztof Halasa <khc@pm.waw.pl>
      Cc: Imre Kaloz <kaloz@openwrt.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: NTim Gardner <tim.gardner@canonical.com>
      Signed-off-by: NKrzysztof Hałasa <khc@pm.waw.pl>
      05cd3db0
    • K
    • K
      87ba5c6a
    • K
      3043c5c8
    • I
      ARM - OMAP: ads7846: fix pendown debounce setting · 0a0d6285
      Igor Grinberg 提交于
      Commit 97ee9f01 (ARM: OMAP: fix the ads7846 init code) have enabled the
      pendown GPIO debounce time setting by the below sequence:
      
        gpio_request_one()
        gpio_set_debounce()
        gpio_free()
      
      It also revealed a bug in the OMAP GPIO handling code which prevented
      the GPIO debounce clock to be disabled and CORE transition to low power
      states.
      
      Commit c9c55d92 (gpio/omap: fix off-mode bug: clear debounce settings on
      free/reset) fixes the OMAP GPIO handling code by making sure that the
      GPIO debounce clock gets disabled if no GPIO is requested from current
      bank.
      
      While fixing the OMAP GPIO handling code (in the right way), the above
      commit makes the gpio_request->set_debounce->free sequence invalid as
      after freeing the GPIO, the debounce settings are lost.
      
      Fix the debounce settings by moving the debounce initialization to the
      actual GPIO requesting code - the ads7846 driver.
      Signed-off-by: NIgor Grinberg <grinberg@compulab.co.il>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      0a0d6285
    • J
      ARM: Kirkwood: Update PCI-E fixup · 1dc831bf
      Jason Gunthorpe 提交于
      - The code relies on rc_pci_fixup being called, which only happens
        when CONFIG_PCI_QUIRKS is enabled, so add that to Kconfig. Omitting
        this causes a booting failure with a non-obvious cause.
      - Update rc_pci_fixup to set the class properly, copying the
        more modern style from other places
      - Correct the rc_pci_fixup comment
      Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJason Cooper <jason@lakedaemon.net>
      1dc831bf
    • R
      Dove: Fix irq_to_pmu() · d356cf5a
      Russell King - ARM Linux 提交于
      PMU interrupts start at IRQ_DOVE_PMU_START, not IRQ_DOVE_PMU_START + 1.
      Fix the condition.  (It may have been less likely to occur had the code
      been written "if (irq >= IRQ_DOVE_PMU_START" which imho is the easier
      to understand notation, and matches the normal way of thinking about
      these things.)
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJason Cooper <jason@lakedaemon.net>
      d356cf5a
    • R
      Dove: Attempt to fix PMU/RTC interrupts · 5d3df935
      Russell King - ARM Linux 提交于
      Fix the acknowledgement of PMU interrupts on Dove: some Dove hardware
      has not been sensibly designed so that interrupts can be handled in a
      race free manner.  The PMU is one such instance.
      
      The pending (aka 'cause') register is a bunch of RW bits, meaning that
      these bits can be both cleared and set by software (confirmed on the
      Armada-510 on the cubox.)
      
      Hardware sets the appropriate bit when an interrupt is asserted, and
      software is required to clear the bits which are to be processed.  If
      we write ~(1 << bit), then we end up asserting every other interrupt
      except the one we're processing.  So, we need to do a read-modify-write
      cycle to clear the asserted bit.
      
      However, any interrupts which occur in the middle of this cycle will
      also be written back as zero, which will also clear the new interrupts.
      
      The upshot of this is: there is _no_ way to safely clear down interrupts
      in this register (and other similarly behaving interrupt pending
      registers on this device.)  The patch below at least stops us creating
      new interrupts.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJason Cooper <jason@lakedaemon.net>
      5d3df935
  10. 21 11月, 2012 6 次提交