1. 20 Mar, 2013 11 commits
  2. 14 Mar, 2013 22 commits
  3. 03 Mar, 2013 7 commits
    • Greg Kroah-Hartman's avatar
      Linux 3.0.68 · e28c3f2b
      Greg Kroah-Hartman authored
      e28c3f2b
    • Ian Abbott's avatar
      staging: comedi: check s->async for poll(), read() and write() · 6c80ee53
      Ian Abbott authored
      commit cc400e18 upstream.
      
      Some low-level comedi drivers (incorrectly) point `dev->read_subdev` or
      `dev->write_subdev` to a subdevice that does not support asynchronous
      commands.  Comedi's poll(), read() and write() file operation handlers
      assume these subdevices do support asynchronous commands.  In
      particular, they assume `s->async` is valid (where `s` points to the
      read or write subdevice), which it won't be if it has been set
      incorrectly.  This can lead to a NULL pointer dereference.
      
      Check `s->async` is non-NULL in `comedi_poll()`, `comedi_read()` and
      `comedi_write()` to avoid the bug.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6c80ee53
    • Ian Abbott's avatar
      staging: comedi: ni_labpc: set up command4 register *after* command3 · 544da440
      Ian Abbott authored
      Commit 22056e2b upstream.
      
      Tuomas <tvainikk _at_ gmail _dot_ com> reported problems getting
      meaningful output from a Lab-PC+ in differential mode for AI cmds, but
      AI insn reads gave correct readings.  He tracked it down to two
      problems, one of which is addressed by this patch.
      
      It seems that writing to the command3 register after writing to the
      command4 register in `labpc_ai_cmd()` messes up the differential
      reference bit setting in the command4 register.  Set up the command4
      register after the command3 register (as in `labpc_ai_rinsn()`) to avoid
      the problem.
      
      Thanks to Tuomas for suggesting the fix.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      544da440
    • Ian Abbott's avatar
      staging: comedi: ni_labpc: correct differential channel sequence for AI commands · 5e6af63d
      Ian Abbott authored
      Commit 4c4bc25d upstream.
      
      Tuomas <tvainikk _at_ gmail _dot_ com> reported problems getting
      meaningful output from a Lab-PC+ in differential mode for AI cmds, but
      AI insn reads gave correct readings.  He tracked it down to two
      problems, one of which is addressed by this patch.
      
      It seems the setting of the channel bits for particular scanning modes
      was incorrect for differential mode.  (Only half the number of channels
      are available in differential mode; comedi refers to them as channels 0,
      1, 2 and 3, but the hardware documentation refers to them as channels 0,
      2, 4 and 6.)  In differential mode, the setting of the channel enable
      bits in the command1 register should depend on whether the scan enable
      bit is set.  Effectively, we need to double the comedi channel number
      when the scan enable bit is not set in differential mode.  The scan
      enable bit gets set when the AI scan mode is `MODE_MULT_CHAN_UP` or
      `MODE_MULT_CHAN_DOWN`, and gets cleared when the AI scan mode is
      `MODE_SINGLE_CHAN` or `MODE_SINGLE_CHAN_INTERVAL`.  The existing test
      for whether the comedi channel number needs to be doubled in
      differential mode is incorrect in `labpc_ai_cmd()`.  This patch corrects
      the test.
      
      Thanks to Tuomas for suggesting the fix.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5e6af63d
    • Jiri Slaby's avatar
      s390/kvm: Fix store status for ACRS/FPRS fix · d81d788d
      Jiri Slaby authored
      In 3.0.67, commit 58c9ce6f (s390/kvm:
      Fix store status for ACRS/FPRS), upstream commit
      15bc8d84, added a call to
      save_access_regs to save ACRS. But we do not have ARCS in kvm_run in
      3.0 yet, so this results in:
      arch/s390/kvm/kvm-s390.c: In function 'kvm_s390_vcpu_store_status':
      arch/s390/kvm/kvm-s390.c:593: error: 'struct kvm_run' has no member named 's'
      
      Fix it by saving guest_acrs which is where ARCS are in 3.0.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d81d788d
    • Jiri Slaby's avatar
      dca: check against empty dca_domains list before unregister provider fix · 55bce39d
      Jiri Slaby authored
      In 3.0.67, commit 7a9a20ea (dca: check
      against empty dca_domains list before unregister provider), upstream
      commit c419fcfd, added a fail path to
      unregister_dca_provider. It added there also a call to
      raw_spin_unlock_irqrestore. But in 3.0, the lock is not raw, so this
      results in:
      drivers/dca/dca-core.c: In function 'unregister_dca_provider':
      drivers/dca/dca-core.c:413: warning: passing argument 1 of '_raw_spin_unlock_irqrestore' from incompatible pointer type
      
      Fix it by calling spin_unlock_irqrestore properly.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      55bce39d
    • Li Zefan's avatar
      cgroup: fix exit() vs rmdir() race · cc0e3e13
      Li Zefan authored
      commit 71b5707e upstream.
      
      In cgroup_exit() put_css_set_taskexit() is called without any lock,
      which might lead to accessing a freed cgroup:
      
      thread1                           thread2
      ---------------------------------------------
      exit()
        cgroup_exit()
          put_css_set_taskexit()
            atomic_dec(cgrp->count);
                                         rmdir();
            /* not safe !! */
            check_for_release(cgrp);
      
      rcu_read_lock() can be used to make sure the cgroup is alive.
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cc0e3e13