Vulnerability · Published May 13, 2024 · Assigned by Linux

CVE-2024-27398Bluetooth: Fix use-after-free bugs caused by sco_sock_timeout

High 8.0

In plain English

A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.8% (higher than 58% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)8.0High
Exploit odds (30 days)0.8%top 42.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

Official description

In the Linux kernel, the following vulnerability has been resolved: Bluetooth: Fix use-after-free bugs caused by sco_sock_timeout When the sco connection is established and then, the sco socket is releasing, timeout_work will be scheduled to judge whether the sco disconnection is timeout. The sock will be deallocated later, but it is dereferenced again in sco_sock_timeout. As a result, the use-after-free bugs will happen. The root cause is shown below: Cleanup Thread | Worker Thread sco_sock_release | sco_sock_close | __sco_sock_close | sco_sock_set_timer | schedule_delayed_work | sco_sock_kill | (wait a time) sock_put(sk) //FREE | sco_sock_timeout | sock_hold(sk) //USE The KASAN report triggered by POC is shown below: [ 95.890016] ================================================================== [ 95.890496] BUG: KASAN: slab-use-after-free in sco_sock_timeout+0x5e/0x1c0 [ 95.890755] Write of size 4 at addr ffff88800c388080 by task kworker/0:0/7 ... [ 95.890755] Workqueue: events sco_sock_timeout [ 95.890755] Call Trace: [ 95.890755] <TASK> [ 95.890755] dump_stack_lvl+0x45/0x110 [ 95.890755] print_address_description+0x78/0x390 [ 95.890755] print_report+0x11b/0x250 [ 95.890755] ? __virt_addr_valid+0xbe/0xf0 [ 95.890755] ? sco_sock_timeout+0x5e/0x1c0 [ 95.890755] kasan_report+0x139/0x170 [ 95.890755] ? update_load_avg+0xe5/0x9f0 [ 95.890755] ? sco_sock_timeout+0x5e/0x1c0 [ 95.890755] kasan_check_range+0x2c3/0x2e0 [ 95.890755] sco_sock_timeout+0x5e/0x1c0 [ 95.890755] process_one_work+0x561/0xc50 [ 95.890755] worker_thread+0xab2/0x13c0 [ 95.890755] ? pr_cont_work+0x490/0x490 [ 95.890755] kthread+0x279/0x300 [ 95.890755] ? pr_cont_work+0x490/0x490 [ 95.890755] ? kthread_blkcg+0xa0/0xa0 [ 95.890755] ret_from_fork+0x34/0x60 [ 95.890755] ? kthread_blkcg+0xa0/0xa0 [ 95.890755] ret_from_fork_asm+0x11/0x20 [ 95.890755] </TASK> [ 95.890755] [ 95.890755] Allocated by task 506: [ 95.890755] kasan_save_track+0x3f/0x70 [ 95.890755] __kasan_kmalloc+0x86/0x90 [ 95.890755] __kmalloc+0x17f/0x360 [ 95.890755] sk_prot_alloc+0xe1/0x1a0 [ 95.890755] sk_alloc+0x31/0x4e0 [ 95.890755] bt_sock_alloc+0x2b/0x2a0 [ 95.890755] sco_sock_create+0xad/0x320 [ 95.890755] bt_sock_create+0x145/0x320 [ 95.890755] __sock_create+0x2e1/0x650 [ 95.890755] __sys_socket+0xd0/0x280 [ 95.890755] __x64_sys_socket+0x75/0x80 [ 95.890755] do_syscall_64+0xc4/0x1b0 [ 95.890755] entry_SYSCALL_64_after_hwframe+0x67/0x6f [ 95.890755] [ 95.890755] Freed by task 506: [ 95.890755] kasan_save_track+0x3f/0x70 [ 95.890755] kasan_save_free_info+0x40/0x50 [ 95.890755] poison_slab_object+0x118/0x180 [ 95.890755] __kasan_slab_free+0x12/0x30 [ 95.890755] kfree+0xb2/0x240 [ 95.890755] __sk_destruct+0x317/0x410 [ 95.890755] sco_sock_release+0x232/0x280 [ 95.890755] sock_close+0xb2/0x210 [ 95.890755] __fput+0x37f/0x770 [ 95.890755] task_work_run+0x1ae/0x210 [ 95.890755] get_signal+0xe17/0xf70 [ 95.890755] arch_do_signal_or_restart+0x3f/0x520 [ 95.890755] syscall_exit_to_user_mode+0x55/0x120 [ 95.890755] do_syscall_64+0xd1/0x1b0 [ 95.890755] entry_SYSCALL_64_after_hwframe+0x67/0x6f [ 95.890755] [ 95.890755] The buggy address belongs to the object at ffff88800c388000 [ 95.890755] which belongs to the cache kmalloc-1k of size 1024 [ 95.890755] The buggy address is located 128 bytes inside of [ 95.890755] freed 1024-byte region [ffff88800c388000, ffff88800c388400) [ 95.890755] [ 95.890755] The buggy address belongs to the physical page: [ 95.890755] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88800c38a800 pfn:0xc388 [ 95.890755] head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 [ 95.890755] ano ---truncated---

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.94-1DEBIAN-CVE-2024-27398
Debian:13linux6.8.11-1DEBIAN-CVE-2024-27398
Debian:14linux6.8.11-1DEBIAN-CVE-2024-27398
Ubuntu:22.04:LTSlinux5.15.0-118.128USN-6950-1
Ubuntu:22.04:LTSlinux5.15.0-118.128UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux6.8.0-40.40UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux6.8.0-40.40USN-6949-1
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-aws5.15.0-1067.73UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-aws5.15.0-1067.73USN-6950-1
Ubuntu:24.04:LTSlinux-aws6.8.0-1013.14UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-aws6.8.0-1013.14USN-6949-1
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1013.14~22.04.1UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-azure5.15.0-1070.79USN-6956-1
Ubuntu:22.04:LTSlinux-azure5.15.0-1070.79UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-azure6.8.0-1012.14UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-azure6.8.0-1012.14USN-6952-2
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1012.14~22.04.1UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1070.79.1UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1070.79.1USN-6956-1
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-gcp5.15.0-1066.74UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-gcp5.15.0-1066.74USN-6950-1
Ubuntu:24.04:LTSlinux-gcp6.8.0-1012.13UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-gcp6.8.0-1012.13USN-6949-1
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1012.13~22.04.1UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-gke5.15.0-1064.70UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-gke5.15.0-1064.70USN-6950-1
Ubuntu:24.04:LTSlinux-gke6.8.0-1008.11USN-6949-1
Ubuntu:24.04:LTSlinux-gke6.8.0-1008.11UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1050.57UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1050.57USN-6950-1
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-40.40~22.04.3UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-ibm5.15.0-1060.63UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-ibm5.15.0-1060.63USN-6950-2
Ubuntu:24.04:LTSlinux-ibm6.8.0-1010.10USN-6949-1
Ubuntu:24.04:LTSlinux-ibm6.8.0-1010.10UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1010.10~22.04.1UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1062.68USN-6950-1
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1062.68UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-kvm5.15.0-1064.69UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-kvm5.15.0-1064.69USN-6950-1
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-118.128UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-118.128USN-6950-1
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-40.40.1UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-40.40.1USN-6949-2
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-40.40.1~22.04.1UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1062.63UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1062.63USN-6950-1
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1011.11USN-6949-1
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1011.11UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1011.11~22.04.1USN-6949-1
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1011.11~22.04.1UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1011.11.1UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1011.11.1USN-6952-1
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1027.27UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1015.15UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1010.10UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1010.10USN-6955-1
Ubuntu:22.04:LTSlinux-oracle5.15.0-1065.71USN-6950-3
Ubuntu:22.04:LTSlinux-oracle5.15.0-1065.71UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-oracle6.8.0-1010.10USN-6952-1
Ubuntu:24.04:LTSlinux-oracle6.8.0-1010.10UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1010.10~22.04.1UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-raspi5.15.0-1060.63USN-6950-2
Ubuntu:22.04:LTSlinux-raspi5.15.0-1060.63UBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-raspi6.8.0-1009.10USN-6949-2
Ubuntu:24.04:LTSlinux-raspi6.8.0-1009.10UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-27398
Ubuntu:24.04:LTSlinux-riscv6.8.0-40.40.1UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-40.40.1~22.04.1UBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-27398
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1035.39UBUNTU-CVE-2024-27398

Affected products (as reported)

VendorProductVersions
Linux Linux 48669c81a65628ef234cbdd91b9395952c7c27fe – before 1b33d55fb7355e27f8c82cd4ecd560f16246924937d7ae2b0578f2373674a755402ee722e96edc08 – before 3212afd00e3cda790fd0583cb3eaef8f9575a014a1073aad497d0d071a71f61b721966a176d50c08 – before 33a6e92161a78c1073d90e27abe28d746feb0a53ba316be1b6a00db7126ed9a39f9bee434a508043 – before 6a18eeb1b3bbc67c20d9609c31dca6a69b4bcde5ba316be1b6a00db7126ed9a39f9bee434a508043 – before bfab2c1f7940a232cd519e82fff137e308abfd93ba316be1b6a00db7126ed9a39f9bee434a508043 – before 012363cb1bec5f33a7b94629ab2c1086f30280f2ba316be1b6a00db7126ed9a39f9bee434a508043 – before 50c2037fc28df870ef29d9728c770c8955d32178ba316be1b6a00db7126ed9a39f9bee434a508043 – before 483bc08181827fc475643272ffb69c533007e546
Linux Linux 5.15

References