In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: Fix race condition in hci_cmd_sync_clear
There is a potential race condition in hci_cmd_sync_work and
hci_cmd_sync_clear, and could lead to use-after-free. For instance,
hci_cmd_sync_work is added to the 'req_workqueue' after cancel_work_sync
The entry of 'cmd_sync_work_list' may be freed in hci_cmd_sync_clear, and
causing kernel panic when it is used in 'hci_cmd_sync_work'.
Here's the call trace:
dump_stack_lvl+0x49/0x63print_report.cold+0x5e/0x5d3? hci_cmd_sync_work+0x282/0x320kasan_report+0xaa/0x120? hci_cmd_sync_work+0x282/0x320__asan_report_load8_noabort+0x14/0x20hci_cmd_sync_work+0x282/0x320process_one_work+0x77b/0x11c0? _raw_spin_lock_irq+0x8e/0xf0worker_thread+0x544/0x1180? poll_idle+0x1e0/0x1e0kthread+0x285/0x320? process_one_work+0x11c0/0x11c0? kthread_complete_and_exit+0x30/0x30ret_from_fork+0x22/0x30</TASK>Allocated by task 266:kasan_save_stack+0x26/0x50__kasan_kmalloc+0xae/0xe0kmem_cache_alloc_trace+0x191/0x350hci_cmd_sync_queue+0x97/0x2b0hci_update_passive_scan+0x176/0x1d0le_conn_complete_evt+0x1b5/0x1a00hci_le_conn_complete_evt+0x234/0x340hci_le_meta_evt+0x231/0x4e0hci_event_packet+0x4c5/0xf00hci_rx_work+0x37d/0x880process_one_work+0x77b/0x11c0worker_thread+0x544/0x1180kthread+0x285/0x320ret_from_fork+0x22/0x30Freed by task 269:kasan_save_stack+0x26/0x50kasan_set_track+0x25/0x40kasan_set_free_info+0x24/0x40____kasan_slab_free+0x176/0x1c0__kasan_slab_free+0x12/0x20slab_free_freelist_hook+0x95/0x1a0kfree+0xba/0x2f0hci_cmd_sync_clear+0x14c/0x210hci_unregister_dev+0xff/0x440vhci_release+0x7b/0xf0__fput+0x1f3/0x970____fput+0xe/0x20task_work_run+0xd4/0x160do_exit+0x8b0/0x22a0do_group_exit+0xba/0x2a0get_signal+0x1e4a/0x25b0arch_do_signal_or_restart+0x93/0x1f80exit_to_user_mode_prepare+0xf5/0x1a0syscall_exit_to_user_mode+0x26/0x50ret_from_fork+0x15/0x30