]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: hci_{ldisc,serdev}: check percpu_init_rwsem() failure
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Mon, 29 Aug 2022 14:58:12 +0000 (23:58 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 07:57:11 +0000 (09:57 +0200)
commit75b2c71ea581c7bb1303860d89366a42ad0506d2
tree7daa934171e90a06e6eb1cb3a3432a45f29bad91
parentf8a77dbb88377b16760bc6e1881630f2e3dcaff4
Bluetooth: hci_{ldisc,serdev}: check percpu_init_rwsem() failure

[ Upstream commit 3124d320c22f3f4388d9ac5c8f37eaad0cefd6b1 ]

syzbot is reporting NULL pointer dereference at hci_uart_tty_close() [1],
for rcu_sync_enter() is called without rcu_sync_init() due to
hci_uart_tty_open() ignoring percpu_init_rwsem() failure.

While we are at it, fix that hci_uart_register_device() ignores
percpu_init_rwsem() failure and hci_uart_unregister_device() does not
call percpu_free_rwsem().

Link: https://syzkaller.appspot.com/bug?extid=576dfca25381fb6fbc5f
Reported-by: syzbot <syzbot+576dfca25381fb6fbc5f@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: 67d2f8781b9f00d1 ("Bluetooth: hci_ldisc: Allow sleeping while proto locks are held.")
Fixes: d73e172816652772 ("Bluetooth: hci_serdev: Init hci_uart proto_lock to avoid oops")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/hci_ldisc.c
drivers/bluetooth/hci_serdev.c