lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 2 Aug 2021 20:17:02 +0700
From:   Ammar Faizi <ammarfaizi2@...weeb.org>
To:     Marcel Holtmann <marcel@...tmann.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        Luiz Augusto von Dentz <luiz.dentz@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>
Cc:     linux-bluetooth@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, Ammar Faizi <ammarfaizi2@...il.com>,
        Ammar Faizi <ammarfaizi2@...weeb.org>
Subject: WARNING: possible circular locking dependency detected
 (hci_sock_dev_event+0x17d/0x1f0)

Hi everyone,

I found a potential deadlock at hci_sock_dev_event.

Kernel version: 5.14.0-rc3-bluetea-test-00249-gc7d102232649

If you need more detailed information, please let me know what to
provide. I would be happy to help.

Here is the warning from kernel log:
(I also attached a file for complete version of this log (dmesg.txt)).

<4>[40642.390715][T49014]
======================================================
<4>[40642.390717][T49014] WARNING: possible circular locking dependency
detected
<4>[40642.390718][T49014] 5.14.0-rc3-bluetea-test-00249-gc7d102232649 #5
Not tainted
<4>[40642.390721][T49014]
------------------------------------------------------
<4>[40642.390722][T49014] kworker/u8:2/49014 is trying to acquire lock:
<4>[40642.390725][T49014] ffff8881050b6920
(sk_lock-AF_BLUETOOTH-BTPROTO_HCI){+.+.}-{0:0}, at:
hci_sock_dev_event+0x17d/0x1f0 [bluetooth]
<4>[40642.390801][T49014]
<4>[40642.390801][T49014] but task is already holding lock:
<4>[40642.390802][T49014] ffffffffa12463c0
(hci_sk_list.lock){++++}-{2:2}, at: hci_sock_dev_event+0x141/0x1f0
[bluetooth]
<4>[40642.390865][T49014]
<4>[40642.390865][T49014] which lock already depends on the new lock.
<4>[40642.390865][T49014]
<4>[40642.390866][T49014]
<4>[40642.390866][T49014] the existing dependency chain (in reverse
order) is:
<4>[40642.390867][T49014]
<4>[40642.390867][T49014] -> #1 (hci_sk_list.lock){++++}-{2:2}:
<4>[40642.390873][T49014]        _raw_read_lock+0x5d/0x70
<4>[40642.390881][T49014]        hci_sock_sendmsg+0x9e1/0xac0 [bluetooth]
<4>[40642.390938][T49014]        sock_sendmsg+0x33/0x40
<4>[40642.390943][T49014]        ____sys_sendmsg+0x200/0x220
<4>[40642.390946][T49014]        ___sys_sendmsg+0x81/0xc0
<4>[40642.390950][T49014]        __sys_sendmsg+0x59/0xa0
<4>[40642.390954][T49014]        do_syscall_64+0x35/0xb0
<4>[40642.390958][T49014]        entry_SYSCALL_64_after_hwframe+0x44/0xae
<4>[40642.390962][T49014]
<4>[40642.390962][T49014] -> #0
(sk_lock-AF_BLUETOOTH-BTPROTO_HCI){+.+.}-{0:0}:
<4>[40642.390967][T49014]        __lock_acquire+0x119a/0x1e10
<4>[40642.390973][T49014]        lock_acquire+0xc8/0x2f0
<4>[40642.390976][T49014]        lock_sock_nested+0x5d/0x80
<4>[40642.390979][T49014]        hci_sock_dev_event+0x17d/0x1f0 [bluetooth]
<4>[40642.391036][T49014]        hci_unregister_dev+0xea/0x520 [bluetooth]
<4>[40642.391090][T49014]        btusb_disconnect+0x63/0x150 [btusb]
<4>[40642.391097][T49014]        usb_unbind_interface+0x88/0x270
<4>[40642.391102][T49014]        __device_release_driver+0x17d/0x230
<4>[40642.391107][T49014]        device_release_driver+0x26/0x40
<4>[40642.391111][T49014]        usb_forced_unbind_intf+0x6d/0xa0
<4>[40642.391115][T49014]        unbind_marked_interfaces.isra.0+0x42/0x60
<4>[40642.391119][T49014]        usb_resume+0x5d/0x70
<4>[40642.391123][T49014]        dpm_run_callback+0x5e/0x210
<4>[40642.391128][T49014]        device_resume+0x110/0x280
<4>[40642.391131][T49014]        async_resume+0x19/0x30
<4>[40642.391134][T49014]        async_run_entry_fn+0x2a/0x130
<4>[40642.391138][T49014]        process_one_work+0x236/0x530
<4>[40642.391142][T49014]        worker_thread+0x52/0x3b0
<4>[40642.391146][T49014]        kthread+0x135/0x160
<4>[40642.391150][T49014]        ret_from_fork+0x1f/0x30
<4>[40642.391155][T49014]
<4>[40642.391155][T49014] other info that might help us debug this:
<4>[40642.391155][T49014]
<4>[40642.391156][T49014]  Possible unsafe locking scenario:
<4>[40642.391156][T49014]
<4>[40642.391157][T49014]        CPU0                    CPU1
<4>[40642.391158][T49014]        ----                    ----
<4>[40642.391159][T49014]   lock(hci_sk_list.lock);
<4>[40642.391162][T49014]                               
lock(sk_lock-AF_BLUETOOTH-BTPROTO_HCI);
<4>[40642.391165][T49014]                               
lock(hci_sk_list.lock);
<4>[40642.391167][T49014]   lock(sk_lock-AF_BLUETOOTH-BTPROTO_HCI);
<4>[40642.391170][T49014]
<4>[40642.391170][T49014]  *** DEADLOCK ***
<4>[40642.391170][T49014]
<4>[40642.391171][T49014] 5 locks held by kworker/u8:2/49014:
<4>[40642.391173][T49014]  #0: ffff88810004fd38
((wq_completion)events_unbound){+.+.}-{0:0}, at:
process_one_work+0x1bc/0x530
<4>[40642.391184][T49014]  #1: ffffc9000829fe70
((work_completion)(&entry->work)){+.+.}-{0:0}, at:
process_one_work+0x1bc/0x530
<4>[40642.391194][T49014]  #2: ffff88810eb05a20
(&dev->mutex){....}-{3:3}, at: device_resume+0xc6/0x280
<4>[40642.391204][T49014]  #3: ffff88810eb051a8
(&dev->mutex){....}-{3:3}, at: device_release_driver+0x1c/0x40
<4>[40642.391213][T49014]  #4: ffffffffa12463c0
(hci_sk_list.lock){++++}-{2:2}, at: hci_sock_dev_event+0x141/0x1f0
[bluetooth]
<4>[40642.391276][T49014]
<4>[40642.391276][T49014] stack backtrace:
<4>[40642.391278][T49014] CPU: 2 PID: 49014 Comm: kworker/u8:2 Not
tainted 5.14.0-rc3-bluetea-test-00249-gc7d102232649 #5
<4>[40642.391283][T49014] Hardware name: Acer Aspire ES1-421/OLVIA_BE,
BIOS V1.05 07/02/2015
<4>[40642.391287][T49014] Workqueue: events_unbound async_run_entry_fn
<4>[40642.391293][T49014] Call Trace:
<4>[40642.391299][T49014]  dump_stack_lvl+0x6a/0x9a
<4>[40642.391306][T49014]  check_noncircular+0xfe/0x110
<4>[40642.391311][T49014]  ? save_trace+0x42/0x280
<4>[40642.391317][T49014]  __lock_acquire+0x119a/0x1e10
<4>[40642.391327][T49014]  lock_acquire+0xc8/0x2f0
<4>[40642.391331][T49014]  ? hci_sock_dev_event+0x17d/0x1f0 [bluetooth]
<4>[40642.391389][T49014]  ? lock_sock_nested+0x3e/0x80
<4>[40642.391395][T49014]  lock_sock_nested+0x5d/0x80
<4>[40642.391399][T49014]  ? hci_sock_dev_event+0x17d/0x1f0 [bluetooth]
<4>[40642.391457][T49014]  hci_sock_dev_event+0x17d/0x1f0 [bluetooth]
<4>[40642.391515][T49014]  hci_unregister_dev+0xea/0x520 [bluetooth]
<4>[40642.391569][T49014]  ? lockdep_hardirqs_on_prepare+0xff/0x180
<4>[40642.391573][T49014]  ? _raw_spin_unlock_irq+0x24/0x40
<4>[40642.391579][T49014]  ? _raw_spin_unlock_irq+0x24/0x40
<4>[40642.391583][T49014]  ? usb_hcd_flush_endpoint+0x6d/0x170
<4>[40642.391589][T49014]  btusb_disconnect+0x63/0x150 [btusb]
<4>[40642.391598][T49014]  usb_unbind_interface+0x88/0x270
<4>[40642.391605][T49014]  __device_release_driver+0x17d/0x230
<4>[40642.391610][T49014]  device_release_driver+0x26/0x40
<4>[40642.391615][T49014]  usb_forced_unbind_intf+0x6d/0xa0
<4>[40642.391620][T49014]  unbind_marked_interfaces.isra.0+0x42/0x60
<4>[40642.391625][T49014]  usb_resume+0x5d/0x70
<4>[40642.391630][T49014]  ? usb_dev_thaw+0x10/0x10
<4>[40642.391635][T49014]  dpm_run_callback+0x5e/0x210
<4>[40642.391640][T49014]  device_resume+0x110/0x280
<4>[40642.391645][T49014]  ? pm_dev_err+0x34/0x34
<4>[40642.391654][T49014]  async_resume+0x19/0x30
<4>[40642.391657][T49014]  async_run_entry_fn+0x2a/0x130
<4>[40642.391662][T49014]  process_one_work+0x236/0x530
<4>[40642.391670][T49014]  worker_thread+0x52/0x3b0
<4>[40642.391675][T49014]  ? process_one_work+0x530/0x530
<4>[40642.391680][T49014]  kthread+0x135/0x160
<4>[40642.391684][T49014]  ? set_kthread_struct+0x40/0x40
<4>[40642.391690][T49014]  ret_from_fork+0x1f/0x30
<6>[40642.460285][ T2060] ata2: SATA link up 1.5 Gbps (SStatus 113
SControl 300)
<6>[40642.460332][T49658] usb 1-1.4: reset high-speed USB device number
5 using ehci-pci

Regards,
  Ammar


View attachment "dmesg.txt" of type "text/plain" (242197 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ