Luiz Augusto von Dentz
4bcefec363
Bluetooth: hci_sysfs: Fix attempting to call device_add multiple times
...
[ Upstream commit 448a496f760664d3e2e79466aa1787e6abc922b5 ]
device_add shall not be called multiple times as stated in its
documentation:
'Do not call this routine or device_register() more than once for
any device structure'
Syzkaller reports a bug as follows [1]:
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:33!
invalid opcode: 0000 [#1 ] PREEMPT SMP KASAN
[...]
Call Trace:
<TASK>
__list_add include/linux/list.h:69 [inline]
list_add_tail include/linux/list.h:102 [inline]
kobj_kset_join lib/kobject.c:164 [inline]
kobject_add_internal+0x18f/0x8f0 lib/kobject.c:214
kobject_add_varg lib/kobject.c:358 [inline]
kobject_add+0x150/0x1c0 lib/kobject.c:410
device_add+0x368/0x1e90 drivers/base/core.c:3452
hci_conn_add_sysfs+0x9b/0x1b0 net/bluetooth/hci_sysfs.c:53
hci_le_cis_estabilished_evt+0x57c/0xae0 net/bluetooth/hci_event.c:6799
hci_le_meta_evt+0x2b8/0x510 net/bluetooth/hci_event.c:7110
hci_event_func net/bluetooth/hci_event.c:7440 [inline]
hci_event_packet+0x63d/0xfd0 net/bluetooth/hci_event.c:7495
hci_rx_work+0xae7/0x1230 net/bluetooth/hci_core.c:4007
process_one_work+0x991/0x1610 kernel/workqueue.c:2289
worker_thread+0x665/0x1080 kernel/workqueue.c:2436
kthread+0x2e4/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
</TASK>
Link: https://syzkaller.appspot.com/bug?id=da3246e2d33afdb92d66bc166a0934c5b146404a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tested-by: Hawkins Jiawei <yin31149@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:15:46 +02:00
..
2020-01-29 10:24:22 +01:00
2022-08-25 11:09:27 +02:00
2021-08-04 11:58:02 +02:00
2020-01-12 11:24:27 +01:00
2021-04-07 12:05:39 +02:00
2020-10-01 20:40:12 +02:00
2022-03-16 12:49:00 +01:00
2022-03-16 12:49:01 +01:00
2022-10-26 13:15:46 +02:00
2022-09-15 12:39:46 +02:00
2021-09-22 11:43:09 +02:00
2022-02-08 18:15:26 +01:00
2020-11-10 10:23:59 +01:00
2022-09-05 10:23:55 +02:00
2022-03-08 19:00:59 +01:00
2021-09-22 11:43:09 +02:00
2021-07-28 09:14:27 +02:00
2018-07-22 14:27:39 +02:00
2020-04-13 10:32:53 +02:00
2020-01-12 11:24:19 +01:00
2021-05-22 10:40:20 +02:00
2022-10-26 13:15:34 +02:00
2022-10-26 13:15:45 +02:00
2022-08-25 11:09:20 +02:00
2017-05-25 15:44:41 +02:00
2018-09-15 09:43:01 +02:00
2020-12-11 13:37:56 +01:00
2019-04-17 08:36:44 +02:00
2022-09-05 10:23:54 +02:00
2022-06-25 11:45:19 +02:00
2021-02-10 09:09:25 +01:00
2022-03-28 08:06:06 +02:00
2022-10-26 13:15:39 +02:00
2022-09-15 12:39:45 +02:00
2021-03-17 16:10:13 +01:00
2021-01-12 19:49:01 +01:00
2022-09-28 10:55:45 +02:00
2022-01-27 08:47:42 +01:00
2022-05-18 09:15:43 +02:00
2021-07-28 09:14:27 +02:00
2022-06-14 16:52:31 +02:00
2022-10-26 13:15:45 +02:00
2022-04-27 13:14:10 +02:00
2022-01-11 13:38:12 +01:00
2021-03-30 14:41:42 +02:00
2022-10-26 13:15:40 +02:00
2020-01-12 11:24:23 +01:00
2022-09-05 10:23:54 +02:00
2022-06-14 16:52:33 +02:00
2022-09-15 12:39:46 +02:00
2022-06-14 16:52:32 +02:00
2018-04-29 11:32:02 +02:00
2022-09-15 12:39:46 +02:00
2022-09-15 12:39:46 +02:00
2022-01-27 08:47:41 +01:00
2022-08-25 11:09:29 +02:00
2022-09-15 12:39:44 +02:00
2022-04-20 09:06:38 +02:00
2022-10-26 13:15:45 +02:00
2021-06-30 08:49:12 -04:00
2021-08-04 11:58:01 +02:00
2022-09-05 10:23:55 +02:00