1. 09 9月, 2013 1 次提交
    • A
      virtio_pci: pm: Use CONFIG_PM_SLEEP instead of CONFIG_PM · 9e266ece
      Aaron Lu 提交于
      The virtio_pci_freeze/restore are defined under CONFIG_PM but is used
      by SET_SYSTEM_SLEEP_PM_OPS macro, which is defined under
      CONFIG_PM_SLEEP. So if CONFIG_PM_SLEEP is not cofigured but
      CONFIG_PM_RUNTIME is, the following warning message appeared:
      
      drivers/virtio/virtio_pci.c:770:12: warning: ‘virtio_pci_freeze’ defined but not used [-Wunused-function]
       static int virtio_pci_freeze(struct device *dev)
                  ^
      drivers/virtio/virtio_pci.c:790:12: warning: ‘virtio_pci_restore’ defined but not used [-Wunused-function]
       static int virtio_pci_restore(struct device *dev)
                  ^
      Fix it by changing CONFIG_PM to CONFIG_PM_SLEEP.
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Reviewed-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      9e266ece
  2. 06 9月, 2013 3 次提交
    • R
      lguest: fix GPF in guest when using gdb. · aa96a3c6
      Rusty Russell 提交于
      Since the Guest is in ring 1, it can't read the debug registers: doing
      so gives a number of nasty messages:
      
      (gdb) run
      Starting program: /bin/sleep
      [   31.170230] general protection fault: 0000 [#1] SMP
      [   31.170230] Modules linked in:
      [   31.170230] CPU: 0 PID: 2678 Comm: sleep Not tainted 3.11.0+ #64
      [   31.170230] task: cc5c09b0 ti: cc79c000 task.ti: cc79c000
      [   31.170230] EIP: 0061:[<c01333d8>] EFLAGS: 00000097 CPU: 0
      [   31.170230] EIP is at native_get_debugreg+0x58/0x70
      [   31.170230] EAX: 00000006 EBX: cc79dfb4 ECX: b7fff918 EDX: 00000000
      [   31.170230] ESI: cc5c09b0 EDI: 00000000 EBP: cc79df84 ESP: cc79df84
      [   31.170230]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0069
      [   31.170230] CR0: 00000008 CR2: 081ba69a CR3: 0e2f2000 CR4: 00000000
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      aa96a3c6
    • R
      lguest: fix guest kernel stack overflow when TF bit set. · 98fb4e5e
      Rusty Russell 提交于
      The symptoms are that running gdb on a binary causes the guest to
      overflow the kernels stack (after some period of time), resulting in
      it finally being killed with a "Bad address" message.
      Reported-by: NSakari Ailus <sakari.ailus@iki.fi>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      98fb4e5e
    • R
      lguest: fix BUG_ON() in invalid guest page table. · 4623c28e
      Rusty Russell 提交于
      If we discover the entry is invalid, we kill the guest, but we must
      avoid calling gpte_addr() on the invalid pmd, otherwise:
      
      	kernel BUG at drivers/lguest/page_tables.c:157!
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      4623c28e
  3. 09 8月, 2013 12 次提交
  4. 08 8月, 2013 5 次提交
  5. 07 8月, 2013 11 次提交
  6. 06 8月, 2013 1 次提交
  7. 05 8月, 2013 7 次提交
    • L
      regmap: cache: Make sure to sync the last register in a block · 2d49b598
      Lars-Peter Clausen 提交于
      regcache_sync_block_raw_flush() expects the address of the register after last
      register that needs to be synced as its parameter. But the last call to
      regcache_sync_block_raw_flush() in regcache_sync_block_raw() passes the address
      of the last register in the block. This effectively always skips over the last
      register in a block, even if it needs to be synced. In order to fix it increase
      the address by one register.
      
      The issue was introduced in commit 75a5f89f ("regmap: cache: Write consecutive
      registers in a single block write").
      
      Cc: stable@vger.kernel.org # 3.10+
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      2d49b598
    • Z
      vfs: add missing check for __O_TMPFILE in fcntl_init() · 3d62c45b
      Zheng Liu 提交于
      As comment in include/uapi/asm-generic/fcntl.h described, when
      introducing new O_* bits, we need to check its uniqueness in
      fcntl_init().  But __O_TMPFILE bit is missing.  So fix it.
      Signed-off-by: NZheng Liu <wenqing.lz@taobao.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      3d62c45b
    • A
      fs: Allow unprivileged linkat(..., AT_EMPTY_PATH) aka flink · bb2314b4
      Andy Lutomirski 提交于
      Every now and then someone proposes a new flink syscall, and this spawns
      a long discussion of whether it would be a security problem.  I think
      that this is missing the point: flink is *already* allowed without
      privilege as long as /proc is mounted -- it's called AT_SYMLINK_FOLLOW.
      
      Now that O_TMPFILE is here, the ability to create a file with O_TMPFILE,
      write it, and link it in is very convenient.  The only problem is that
      it requires that /proc be mounted so that you can do:
      
      linkat(AT_FDCWD, "/proc/self/fd/<tmpfd>", dfd, path, AT_SYMLINK_NOFOLLOW)
      
      This sucks -- it's much nicer to do:
      
      linkat(tmpfd, "", dfd, path, AT_EMPTY_PATH)
      
      Let's allow it.
      
      If this turns out to be excessively scary, it we could instead require
      that the inode in question be I_LINKABLE, but this seems pointless given
      the /proc situation
      Signed-off-by: NAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      bb2314b4
    • A
      fs: Fix file mode for O_TMPFILE · e305f48b
      Andy Lutomirski 提交于
      O_TMPFILE, like O_CREAT, should respect the requested mode and should
      create regular files.
      
      This fixes two bugs: O_TMPFILE required privilege (because the mode
      ended up as 000) and it produced bogus inodes with no type.
      Signed-off-by: NAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      e305f48b
    • A
      reiserfs: fix deadlock in umount · 672fe15d
      Al Viro 提交于
      Since remove_proc_entry() started to wait for IO in progress (i.e.
      since 2007 or so), the locking in fs/reiserfs/proc.c became wrong;
      if procfs read happens between the moment when umount() locks the
      victim superblock and removal of /proc/fs/reiserfs/<device>/*,
      we'll get a deadlock - read will wait for s_umount (in sget(),
      called by r_start()), while umount will wait in remove_proc_entry()
      for that read to finish, holding s_umount all along.
      
      Fortunately, the same change allows a much simpler race avoidance -
      all we need to do is remove the procfs entries in the very beginning
      of reiserfs ->kill_sb(); that'll guarantee that pointer to superblock
      will remain valid for the duration for procfs IO, so we don't need
      sget() to keep the sucker alive.  As the matter of fact, we can
      get rid of the home-grown iterator completely, and use single_open()
      instead.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      672fe15d
    • F
      MIPS: BMIPS: fix hardware interrupt routing for boot CPU != 0 · fcfa66de
      Florian Fainelli 提交于
      The hardware interrupt routing for boot CPU != 0 is wrong because it
      will route all the hardware interrupts to TP0 which is not the one we
      booted from. Fix this by properly checking which boot CPU we are booting
      from and updating the right interrupt mask for the boot CPU. This fixes
      booting on BCM3368 with bmips_smp_emabled = 0.
      Signed-off-by: NFlorian Fainelli <florian@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: blogic@openwrt.org
      Cc: jogo@openwrt.org
      Cc: cernekee@gmail.com
      Patchwork: https://patchwork.linux-mips.org/patch/5650/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      fcfa66de
    • R
      MIPS: oprofile: Fix BUG due to smp_processor_id() in preemptible code. · cf5b2d23
      Ralf Baechle 提交于
      current_cpu_type() is not preemption-safe.
      If CONFIG_PREEMPT is enabled then mipsxx_reg_setup() can be called from preemptible state.
      Added get_cpu()/put_cpu() pair to make it preemption-safe.
      
      This was found while testing oprofile with CONFIG_DEBUG_PREEMPT enable.
      
      /usr/zntestsuite # opcontrol --init
      /usr/zntestsuite # opcontrol --setup --event=L2_CACHE_ACCESSES:500 --event=L2_CACHE_MISSES:500 --no-vmlinux
      /usr/zntestsuite # opcontrol --start
      Using 2.6+ OProfile kernel interface.
      BUG: using smp_processor_id() in preemptible [00000000] code: oprofiled/1362
      caller is mipsxx_reg_setup+0x11c/0x164
      CPU: 0 PID: 1362 Comm: oprofiled Not tainted 3.10.4 #18
      Stack : 00000006 70757465 00000000 00000000 00000000 00000000 80b173f6 00000037
                80b10000 00000000 80b21614 88f5a220 00000000 00000000 00000000 00000000
                00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
                00000000 00000000 00000000 89c49c00 89c49c2c 80721254 807b7927 8012c1d0
                80b10000 80721254 00000000 00000552 88f5a220 80b1335c 807b78e6 89c49ba8
                ...
      Call Trace:
      [<801099a4>] show_stack+0x64/0x7c
      [<80665520>] dump_stack+0x20/0x2c
      [<803a2250>] debug_smp_processor_id+0xe0/0xf0
      [<8052df24>] mipsxx_reg_setup+0x11c/0x164
      [<8052cd70>] op_mips_setup+0x24/0x4c
      [<80529cfc>] oprofile_setup+0x5c/0x12c
      [<8052b9f8>] event_buffer_open+0x78/0xf8
      [<801c3150>] do_dentry_open.isra.15+0x2b8/0x3b0
      [<801c3270>] finish_open+0x28/0x4c
      [<801d49b8>] do_last.isra.41+0x2cc/0xd00
      [<801d54a0>] path_openat+0xb4/0x4c4
      [<801d5c44>] do_filp_open+0x3c/0xac
      [<801c4744>] do_sys_open+0x110/0x1f4
      [<8010f47c>] stack_done+0x20/0x44
      
      Bug reported and original patch by Jerin Jacob <jerinjacobk@gmail.com>.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Acked-by: NJerin Jacob <jerinjacobk@gmail.com>
      cf5b2d23