1. 02 Aug, 2018 2 commits
    • Xiubo Li's avatar
      uio: fix possible circular locking dependency · b34e9a15
      Xiubo Li authored
      The call trace:
      XXX/1910 is trying to acquire lock:
       (&mm->mmap_sem){++++++}, at: [<ffffffff97008c87>] might_fault+0x57/0xb0
      
      but task is already holding lock:
       (&idev->info_lock){+.+...}, at: [<ffffffffc0638a06>] uio_write+0x46/0x130 [uio]
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #1 (&idev->info_lock){+.+...}:
             [<ffffffff96f31fc9>] lock_acquire+0x99/0x1e0
             [<ffffffff975edad3>] mutex_lock_nested+0x93/0x410
             [<ffffffffc063873d>] uio_mmap+0x2d/0x170 [uio]
             [<ffffffff97016b58>] mmap_region+0x428/0x650
             [<ffffffff97017138>] do_mmap+0x3b8/0x4e0
             [<ffffffff96ffaba3>] vm_mmap_pgoff+0xd3/0x120
             [<ffffffff97015261>] SyS_mmap_pgoff+0x1f1/0x270
             [<ffffffff96e387c2>] SyS_mmap+0x22/0x30
             [<ffffffff975ff315>] system_call_fastpath+0x1c/0x21
      
      -> #0 (&mm->mmap_sem){++++++}:
             [<ffffffff96f30e9c>] __lock_acquire+0xdac/0x15f0
             [<ffffffff96f31fc9>] lock_acquire+0x99/0x1e0
             [<ffffffff97008cb4>] might_fault+0x84/0xb0
             [<ffffffffc0638a74>] uio_write+0xb4/0x130 [uio]
             [<ffffffff9706ffa3>] vfs_write+0xc3/0x1f0
             [<ffffffff97070e2a>] SyS_write+0x8a/0x100
             [<ffffffff975ff315>] system_call_fastpath+0x1c/0x21
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
             CPU0                    CPU1
             ----                    ----
        lock(&idev->info_lock);
                                     lock(&mm->mmap_sem);
                                     lock(&idev->info_lock);
        lock(&mm->mmap_sem);
      
       *** DEADLOCK ***
      1 lock held by XXX/1910:
       #0:  (&idev->info_lock){+.+...}, at: [<ffffffffc0638a06>] uio_write+0x46/0x130 [uio]
      
      stack backtrace:
      CPU: 0 PID: 1910 Comm: XXX Kdump: loaded Not tainted #1
      Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/19/2017
      Call Trace:
       [<ffffffff975e9211>] dump_stack+0x19/0x1b
       [<ffffffff975e260a>] print_circular_bug+0x1f9/0x207
       [<ffffffff96f2f6a7>] check_prevs_add+0x957/0x960
       [<ffffffff96f30e9c>] __lock_acquire+0xdac/0x15f0
       [<ffffffff96f2fb19>] ? mark_held_locks+0xb9/0x140
       [<ffffffff96f31fc9>] lock_acquire+0x99/0x1e0
       [<ffffffff97008c87>] ? might_fault+0x57/0xb0
       [<ffffffff97008cb4>] might_fault+0x84/0xb0
       [<ffffffff97008c87>] ? might_fault+0x57/0xb0
       [<ffffffffc0638a74>] uio_write+0xb4/0x130 [uio]
       [<ffffffff9706ffa3>] vfs_write+0xc3/0x1f0
       [<ffffffff9709349c>] ? fget_light+0xfc/0x510
       [<ffffffff97070e2a>] SyS_write+0x8a/0x100
       [<ffffffff975ff315>] system_call_fastpath+0x1c/0x21
      Signed-off-by: default avatarXiubo Li <xiubli@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b34e9a15
    • Dan Carpenter's avatar
      uio: pruss: fix error handling in probe · 95883676
      Dan Carpenter authored
      There are two bugs here.  First the error codes weren't set on several
      paths.  And second, if the call to request_threaded_irq() inside
      uio_register_device() fails then it would lead to a double free when
      we call uio_unregister_device() inside pruss_cleanup().
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      95883676
  2. 29 Jul, 2018 4 commits
  3. 27 Jul, 2018 1 commit
    • Greg Kroah-Hartman's avatar
      Merge tag 'fsi-updates-2018-07-27' of... · 2d8bc619
      Greg Kroah-Hartman authored
      Merge tag 'fsi-updates-2018-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/linux-fsi into char-misc-next
      
      Ben writes:
      
      Last round of FSI updates for 4.19
      
      This adds a few fixes for things reported since the last merge,
      and the latch batch of changes pending for FSI for 4.19.
      
      That batch is a rather mechanical conversion of the misc devices
      into proper char devices.
      
      The misc devices were ill suited, the minor space for them is
      limited and we can have a lot of chips in a system creating FSI
      devices.
      
      This also allows us to better control (and fix) object lifetime
      getting rid of the bad devm_kzalloc() of the structures containing
      the devices etc...
      
      Finally, we add a chardev to the core FSI that provides raw CFAM
      access to FSI slaves as a replacement for the current "raw" binary
      sysfs file which will be ultimately deprecated and removed.
      2d8bc619
  4. 26 Jul, 2018 6 commits
  5. 25 Jul, 2018 9 commits
  6. 24 Jul, 2018 7 commits
  7. 23 Jul, 2018 7 commits
  8. 21 Jul, 2018 4 commits