1. 19 9月, 2012 1 次提交
    • V
      Bluetooth: Fix not removing power_off delayed work · 78c04c0b
      Vinicius Costa Gomes 提交于
      For example, when a usb reset is received (I could reproduce it
      running something very similar to this[1] in a loop) it could be
      that the device is unregistered while the power_off delayed work
      is still scheduled to run.
      
      Backtrace:
      
      WARNING: at lib/debugobjects.c:261 debug_print_object+0x7c/0x8d()
      Hardware name: To Be Filled By O.E.M.
      ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x26
      Modules linked in: nouveau mxm_wmi btusb wmi bluetooth ttm coretemp drm_kms_helper
      Pid: 2114, comm: usb-reset Not tainted 3.5.0bt-next #2
      Call Trace:
       [<ffffffff8124cc00>] ? free_obj_work+0x57/0x91
       [<ffffffff81058f88>] warn_slowpath_common+0x7e/0x97
       [<ffffffff81059035>] warn_slowpath_fmt+0x41/0x43
       [<ffffffff8124ccb6>] debug_print_object+0x7c/0x8d
       [<ffffffff8106e3ec>] ? __queue_work+0x259/0x259
       [<ffffffff8124d63e>] ? debug_check_no_obj_freed+0x6f/0x1b5
       [<ffffffff8124d667>] debug_check_no_obj_freed+0x98/0x1b5
       [<ffffffffa00aa031>] ? bt_host_release+0x10/0x1e [bluetooth]
       [<ffffffff810fc035>] kfree+0x90/0xe6
       [<ffffffffa00aa031>] bt_host_release+0x10/0x1e [bluetooth]
       [<ffffffff812ec2f9>] device_release+0x4a/0x7e
       [<ffffffff8123ef57>] kobject_release+0x11d/0x154
       [<ffffffff8123ed98>] kobject_put+0x4a/0x4f
       [<ffffffff812ec0d9>] put_device+0x12/0x14
       [<ffffffffa009472b>] hci_free_dev+0x22/0x26 [bluetooth]
       [<ffffffffa0280dd0>] btusb_disconnect+0x96/0x9f [btusb]
       [<ffffffff813581b4>] usb_unbind_interface+0x57/0x106
       [<ffffffff812ef988>] __device_release_driver+0x83/0xd6
       [<ffffffff812ef9fb>] device_release_driver+0x20/0x2d
       [<ffffffff813582a7>] usb_driver_release_interface+0x44/0x7b
       [<ffffffff81358795>] usb_forced_unbind_intf+0x45/0x4e
       [<ffffffff8134f959>] usb_reset_device+0xa6/0x12e
       [<ffffffff8135df86>] usbdev_do_ioctl+0x319/0xe20
       [<ffffffff81203244>] ? avc_has_perm_flags+0xc9/0x12e
       [<ffffffff812031a0>] ? avc_has_perm_flags+0x25/0x12e
       [<ffffffff81050101>] ? do_page_fault+0x31e/0x3a1
       [<ffffffff8135eaa6>] usbdev_ioctl+0x9/0xd
       [<ffffffff811126b1>] vfs_ioctl+0x21/0x34
       [<ffffffff81112f7b>] do_vfs_ioctl+0x408/0x44b
       [<ffffffff81208d45>] ? file_has_perm+0x76/0x81
       [<ffffffff8111300f>] sys_ioctl+0x51/0x76
       [<ffffffff8158db22>] system_call_fastpath+0x16/0x1b
      
      [1] http://cpansearch.perl.org/src/DPAVLIN/Biblio-RFID-0.03/examples/usbreset.cSigned-off-by: NVinicius Costa Gomes <vinicius.gomes@openbossa.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      78c04c0b
  2. 11 7月, 2012 1 次提交
  3. 30 6月, 2012 1 次提交
  4. 19 6月, 2012 1 次提交
  5. 12 6月, 2012 5 次提交
  6. 05 6月, 2012 11 次提交
  7. 17 5月, 2012 1 次提交
  8. 15 5月, 2012 1 次提交
  9. 09 5月, 2012 14 次提交
  10. 16 4月, 2012 2 次提交
  11. 29 3月, 2012 1 次提交
  12. 28 3月, 2012 1 次提交
    • J
      Bluetooth: hci_core: fix NULL-pointer dereference at unregister · 94324962
      Johan Hovold 提交于
      Make sure hci_dev_open returns immediately if hci_dev_unregister has
      been called.
      
      This fixes a race between hci_dev_open and hci_dev_unregister which can
      lead to a NULL-pointer dereference.
      
      Bug is 100% reproducible using hciattach and a disconnected serial port:
      
      0. # hciattach -n /dev/ttyO1 any noflow
      
      1. hci_dev_open called from hci_power_on grabs req lock
      2. hci_init_req executes but device fails to initialise (times out
         eventually)
      3. hci_dev_open is called from hci_sock_ioctl and sleeps on req lock
      4. hci_uart_tty_close calls hci_dev_unregister and sleeps on req lock in
         hci_dev_do_close
      5. hci_dev_open (1) releases req lock
      6. hci_dev_do_close grabs req lock and returns as device is not up
      7. hci_dev_unregister sleeps in destroy_workqueue
      8. hci_dev_open (3) grabs req lock, calls hci_init_req and eventually sleeps
      9. hci_dev_unregister finishes, while hci_dev_open is still running...
      
      [   79.627136] INFO: trying to register non-static key.
      [   79.632354] the code is fine but needs lockdep annotation.
      [   79.638122] turning off the locking correctness validator.
      [   79.643920] [<c00188bc>] (unwind_backtrace+0x0/0xf8) from [<c00729c4>] (__lock_acquire+0x1590/0x1ab0)
      [   79.653594] [<c00729c4>] (__lock_acquire+0x1590/0x1ab0) from [<c00733f8>] (lock_acquire+0x9c/0x128)
      [   79.663085] [<c00733f8>] (lock_acquire+0x9c/0x128) from [<c0040a88>] (run_timer_softirq+0x150/0x3ac)
      [   79.672668] [<c0040a88>] (run_timer_softirq+0x150/0x3ac) from [<c003a3b8>] (__do_softirq+0xd4/0x22c)
      [   79.682281] [<c003a3b8>] (__do_softirq+0xd4/0x22c) from [<c003a924>] (irq_exit+0x8c/0x94)
      [   79.690856] [<c003a924>] (irq_exit+0x8c/0x94) from [<c0013a50>] (handle_IRQ+0x34/0x84)
      [   79.699157] [<c0013a50>] (handle_IRQ+0x34/0x84) from [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c)
      [   79.708648] [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c) from [<c037499c>] (__irq_usr+0x3c/0x60)
      [   79.718048] Exception stack(0xcf281fb0 to 0xcf281ff8)
      [   79.723358] 1fa0:                                     0001e6a0 be8dab00 0001e698 00036698
      [   79.731933] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
      [   79.740509] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff
      [   79.747497] Unable to handle kernel NULL pointer dereference at virtual address 00000000
      [   79.756011] pgd = cf3b4000
      [   79.758850] [00000000] *pgd=8f0c7831, *pte=00000000, *ppte=00000000
      [   79.765502] Internal error: Oops: 80000007 [#1]
      [   79.770294] Modules linked in:
      [   79.773529] CPU: 0    Tainted: G        W     (3.3.0-rc6-00002-gb5d5c87 #421)
      [   79.781066] PC is at 0x0
      [   79.783721] LR is at run_timer_softirq+0x16c/0x3ac
      [   79.788787] pc : [<00000000>]    lr : [<c0040aa4>]    psr: 60000113
      [   79.788787] sp : cf281ee0  ip : 00000000  fp : cf280000
      [   79.800903] r10: 00000004  r9 : 00000100  r8 : b6f234d0
      [   79.806427] r7 : c0519c28  r6 : cf093488  r5 : c0561a00  r4 : 00000000
      [   79.813323] r3 : 00000000  r2 : c054eee0  r1 : 00000001  r0 : 00000000
      [   79.820190] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      [   79.827728] Control: 10c5387d  Table: 8f3b4019  DAC: 00000015
      [   79.833801] Process gpsd (pid: 1265, stack limit = 0xcf2802e8)
      [   79.839965] Stack: (0xcf281ee0 to 0xcf282000)
      [   79.844573] 1ee0: 00000002 00000000 c0040a24 00000000 00000002 cf281f08 00200200 00000000
      [   79.853210] 1f00: 00000000 cf281f18 cf281f08 00000000 00000000 00000000 cf281f18 cf281f18
      [   79.861816] 1f20: 00000000 00000001 c056184c 00000000 00000001 b6f234d0 c0561848 00000004
      [   79.870452] 1f40: cf280000 c003a3b8 c051e79c 00000001 00000000 00000100 3fa9e7b8 0000000a
      [   79.879089] 1f60: 00000025 cf280000 00000025 00000000 00000000 b6f234d0 00000000 00000004
      [   79.887756] 1f80: 00000000 c003a924 c053ad38 c0013a50 fa200000 cf281fb0 ffffffff c0008530
      [   79.896362] 1fa0: 0001e6a0 0000aab8 80000010 c037499c 0001e6a0 be8dab00 0001e698 00036698
      [   79.904998] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
      [   79.913665] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff 00fbf700 04ffff00
      [   79.922302] [<c0040aa4>] (run_timer_softirq+0x16c/0x3ac) from [<c003a3b8>] (__do_softirq+0xd4/0x22c)
      [   79.931945] [<c003a3b8>] (__do_softirq+0xd4/0x22c) from [<c003a924>] (irq_exit+0x8c/0x94)
      [   79.940582] [<c003a924>] (irq_exit+0x8c/0x94) from [<c0013a50>] (handle_IRQ+0x34/0x84)
      [   79.948913] [<c0013a50>] (handle_IRQ+0x34/0x84) from [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c)
      [   79.958404] [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c) from [<c037499c>] (__irq_usr+0x3c/0x60)
      [   79.967773] Exception stack(0xcf281fb0 to 0xcf281ff8)
      [   79.973083] 1fa0:                                     0001e6a0 be8dab00 0001e698 00036698
      [   79.981658] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
      [   79.990234] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff
      [   79.997161] Code: bad PC value
      [   80.000396] ---[ end trace 6f6739840475f9ee ]---
      [   80.005279] Kernel panic - not syncing: Fatal exception in interrupt
      
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      94324962