Skip to content
  1. Aug 10, 2013
    • Oleg Nesterov's avatar
      dlm: kill the unnecessary and wrong device_close()->recalc_sigpending() · 201d3dfa
      Oleg Nesterov authored
      
      
      device_close()->recalc_sigpending() is not needed, sigprocmask() takes
      care of TIF_SIGPENDING correctly.
      
      And without ->siglock it is racy and wrong, it can wrongly clear
      TIF_SIGPENDING and miss a signal.
      
      But even with this patch device_close() is still buggy:
      
        1. sigprocmask() should not be used, we have set_task_blocked(),
           but this is minor.
      
        2. We should never block SIGKILL or SIGSTOP, and this is what
           the code tries to do.
      
        3. This can't protect against SIGKILL or SIGSTOP anyway. Another
           thread can do signal_wake_up(), say, do_signal_stop() or
           complete_signal() or debugger.
      
        4. sigprocmask(SIG_BLOCK, allsigs) doesn't necessarily clears
           TIF_SIGPENDING, say, freezing() or ->jobctl.
      
        5. device_write() looks equally wrong by the same reason.
      
      Looks like, this tries to protect some wait_event_interruptible() logic
      from signals, it should be turned into uninterruptible wait.  Or we need
      to implement something like signals_stop/start for such a use-case.
      
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      201d3dfa
  2. Aug 09, 2013
  3. Aug 08, 2013
  4. Aug 07, 2013
  5. Aug 06, 2013
  6. Aug 05, 2013
    • Lars-Peter Clausen's avatar
      regmap: cache: Make sure to sync the last register in a block · 2d49b598
      Lars-Peter Clausen authored
      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: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      2d49b598
    • Zheng Liu's avatar
      vfs: add missing check for __O_TMPFILE in fcntl_init() · 3d62c45b
      Zheng Liu authored
      
      
      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: default avatarZheng Liu <wenqing.lz@taobao.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      3d62c45b
    • Andy Lutomirski's avatar
      fs: Allow unprivileged linkat(..., AT_EMPTY_PATH) aka flink · bb2314b4
      Andy Lutomirski authored
      
      
      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: default avatarAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      bb2314b4
    • Andy Lutomirski's avatar
      fs: Fix file mode for O_TMPFILE · e305f48b
      Andy Lutomirski authored
      
      
      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: default avatarAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      e305f48b
    • Al Viro's avatar
      reiserfs: fix deadlock in umount · 672fe15d
      Al Viro authored
      
      
      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: default avatarAl Viro <viro@zeniv.linux.org.uk>
      672fe15d
    • Florian Fainelli's avatar
      MIPS: BMIPS: fix hardware interrupt routing for boot CPU != 0 · fcfa66de
      Florian Fainelli authored
      
      
      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: default avatarFlorian 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: default avatarRalf Baechle <ralf@linux-mips.org>
      fcfa66de
    • Ralf Baechle's avatar
      MIPS: oprofile: Fix BUG due to smp_processor_id() in preemptible code. · cf5b2d23
      Ralf Baechle authored
      
      
      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: default avatarRalf Baechle <ralf@linux-mips.org>
      Acked-by: default avatarJerin Jacob <jerinjacobk@gmail.com>
      cf5b2d23
    • Markos Chandras's avatar
      MIPS: PNX833x: PNX8335_PCI_ETHERNET_INT depends on CONFIG_SOC_PNX8335 · 3ac3bcb9
      Markos Chandras authored
      
      
      The PNX8335_PCI_ETHERNET_INT macro is defined in
      arch/mips/include/asm/mach-pnx833x/irq-mapping.h
      only if CONFIG_SOC_PNX8335 is selected.
      
      Fixes the following randconfig problem:
      arch/mips/pnx833x/common/platform.c:210:12:
      error: 'PNX8335_PIC_ETHERNET_INT' undeclared here
      (not in a function)
      
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Acked-by: default avatarSteven J. Hill <Steven.Hill@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/5585/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      3ac3bcb9
    • Lucas Stach's avatar
      ARM: tegra: enable ULPI phy on Colibri T20 · a1632ad3
      Lucas Stach authored
      This was missed when splitting out the phy from the controller node in
      commit 9dffe3be
      
       (ARM: tegra: modify ULPI reset GPIO properties).
      
      Signed-off-by: default avatarLucas Stach <dev@lynxeye.de>
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      a1632ad3
    • Linus Torvalds's avatar
      Linux 3.11-rc4 · c095ba72
      Linus Torvalds authored
      c095ba72
    • Srinivas Kandagatla's avatar
      ARM: STi: remove sti_secondary_start from INIT section. · d6f67eb7
      Srinivas Kandagatla authored
      
      
      This patch removes sti_secondary_start from _INIT section, there are 2
      reason for this removal.
       1. discarding such a small code does not save much, given the RAM
      sizes.
       2. Having this code discarded, creates corruption issue when we boot
      smp-kernel with nrcpus=1 or with single cpu node in DT.
      
      Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@st.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      d6f67eb7
    • Srinivas Kandagatla's avatar
      ARM: STi: Fix cpu nodes with correct device_type. · 95e8ce69
      Srinivas Kandagatla authored
      
      
      This patch fixes cpu nodes with device_type = "cpu". This change was not
      necessary before 3.10-rc7.
      Without this patch STi SOCs does not boot as SMP.
      
      Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@st.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      95e8ce69