CVE-2024-27398

Updated:

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---

CVSS3: 5.5


Vendor State

OS Vendor version Errata
Ubuntu 20.04 5.4.0-192.212 USN-6951-1
Ubuntu 20.04 AWS 5.4.0-1130.140 USN-6951-1
Ubuntu 16.04 HWE ESM 4.15.0-229.241~16.04.1 USN-7028-1
Ubuntu 16.04 GCP ESM 4.15.0-1166.183~16.04.1 USN-7028-1
Ubuntu 16.04 AWS HWE ESM 4.15.0-1173.186~16.04.1 USN-7028-1
Ubuntu 16.04 Azure ESM 4.15.0-1181.196~16.04.1 USN-7028-1
Debian 11 5.10.218-1 DSA-5703-1
Ubuntu 22.04 5.15.0-118.128 USN-6950-1
Ubuntu 22.04 AWS 5.15.0-1067.73 USN-6950-1
Ubuntu 22.04 Azure 5.15.0-1070.79 USN-6956-1
Debian 11 cloud 5.10.218-1 DSA-5703-1
Ubuntu 20.04 HWE AWS 5.15.0-1067.73~20.04.1 USN-6950-2
Ubuntu 20.04 HWE Azure 5.15.0-1070.79~20.04.1 USN-6956-1
Ubuntu 20.04 GCP 5.4.0-1134.143 USN-6951-1
Ubuntu 24.04 6.8.0-40.40 USN-6949-1

KernelCare State

OS Original kernel version State
Ubuntu 18.04
Planned
Ubuntu 18.04 AWS
Planned
Ubuntu 20.04
In Progress
Ubuntu 20.04 AWS
In Progress
Ubuntu 16.04 HWE ESM
Planned
Ubuntu 16.04 GCP ESM
Planned
Ubuntu 16.04 AWS HWE ESM
Planned
Ubuntu 16.04 Azure ESM
Planned
Debian 11
5.10.70-1 show all hide all
5.10.84-1 5.10.92-1 5.10.92-2 5.10.103-1 5.10.106-1 5.10.113-1 5.10.120-1 5.10.127-1 5.10.127-2 5.10.136-1 5.10.140-1 5.10.149-1 5.10.149-2 5.10.158-2 5.10.162-1 5.10.179-1 5.10.179-2 5.10.179-3 5.10.179-5 5.10.191-1 5.10.197-1 5.10.178-3 5.10.205-2 5.10.205-1 5.10.209-2 5.10.216-1
Released
Ubuntu 22.04
5.15.0-27.28 show all hide all
5.15.0-33.34 5.15.0-37.39 5.15.0-39.42 5.15.0-25.25 5.15.0-28.29 5.15.0-29.30 5.15.0-30.31 5.15.0-41.44 5.15.0-43.46 5.15.0-46.49 5.15.0-35.36 5.15.0-47.51 5.15.0-48.54 5.15.0-40.43 5.15.0-50.56 5.15.0-52.58 5.15.0-53.59 5.15.0-56.62 5.15.0-54.60 5.15.0-57.63 5.15.0-58.64 5.15.0-60.66 5.15.0-67.74 5.15.0-69.76 5.15.0-70.77 5.15.0-71.78 5.15.0-72.79 5.15.0-68.75 5.15.0-73.80 5.15.0-75.82 5.15.0-76.83 5.15.0-78.85 5.15.0-79.86 5.15.0-82.91 5.15.0-83.92 5.15.0-84.93 5.15.0-86.96 5.15.0-74.81 5.15.0-87.97 5.15.0-88.98 5.15.0-89.99 5.15.0-91.101 5.15.0-92.102 5.15.0-94.104 5.15.0-97.107 5.15.0-100.110 5.15.0-101.111 5.15.0-102.112 5.15.0-105.115 5.15.0-106.116 5.15.0-107.117 5.15.0-112.122 5.15.0-113.123 5.15.0-116.126 5.15.0-117.127
Released
Ubuntu 22.04 AWS
5.15.0-1005.7 show all hide all
5.15.0-1008.10 5.15.0-1011.14 5.15.0-1013.17 5.15.0-1015.19 5.15.0-1017.21 5.15.0-1009.11 5.15.0-1020.24 5.15.0-1021.25 5.15.0-1022.26 5.15.0-1023.27 5.15.0-1026.30 5.15.0-1004.6 5.15.0-1014.18 5.15.0-1018.22 5.15.0-1024.29 5.15.0-1027.31 5.15.0-1028.32 5.15.0-1030.34 5.15.0-1031.35 5.15.0-1033.37 5.15.0-1034.38 5.15.0-1035.39 5.15.0-1036.40 5.15.0-1032.36 5.15.0-1037.41 5.15.0-1038.43 5.15.0-1039.44 5.15.0-1040.45 5.15.0-1042.47 5.15.0-1043.48 5.15.0-1044.49 5.15.0-1045.50 5.15.0-1047.52 5.15.0-1048.53 5.15.0-1049.54 5.15.0-1050.55 5.15.0-1051.56 5.15.0-1052.57 5.15.0-1053.58 5.15.0-1055.60 5.15.0-1056.61 5.15.0-1057.63 5.15.0-1060.66 5.15.0-1061.67 5.15.0-1062.68 5.15.0-1063.69 5.15.0-1064.70 5.15.0-1065.71 5.15.0-1066.72
Released
Ubuntu 22.04 Azure
5.15.0-1005.6 show all hide all
5.15.0-1007.8 5.15.0-1010.12 5.15.0-1012.15 5.15.0-1014.17 5.15.0-1017.20 5.15.0-1008.9 5.15.0-1019.24 5.15.0-1020.25 5.15.0-1021.26 5.15.0-1022.27 5.15.0-1003.4 5.15.0-1013.16 5.15.0-1023.29 5.15.0-1029.36 5.15.0-1024.30 5.15.0-1034.41 5.15.0-1035.42 5.15.0-1036.43 5.15.0-1037.44 5.15.0-1038.45 5.15.0-1039.46 5.15.0-1040.47 5.15.0-1041.48 5.15.0-1042.49 5.15.0-1045.52 5.15.0-1046.53 5.15.0-1047.54 5.15.0-1049.56 5.15.0-1044.51 5.15.0-1050.57 5.15.0-1051.59 5.15.0-1052.60 5.15.0-1053.61 5.15.0-1054.62 5.15.0-1056.64 5.15.0-1057.65 5.15.0-1058.66 5.15.0-1059.67 5.15.0-1060.69 5.15.0-1061.70 5.15.0-1063.72 5.15.0-1064.73 5.15.0-1066.75 5.15.0-1067.76 5.15.0-1068.77
Released
Debian 11 cloud
5.10.113-1 show all hide all
5.10.179-2 5.10.179-3 5.10.179-5 5.10.191-1 5.10.197-1 5.10.205-2 5.10.209-2 5.10.216-1
Released
Ubuntu 20.04 HWE AWS
5.15.0-1026.30~20.04.2 show all hide all
5.15.0-1022.26~20.04.1 5.15.0-1023.27~20.04.1 5.15.0-1021.25~20.04.1 5.15.0-1020.24~20.04.1 5.15.0-1017.21~20.04.1 5.15.0-1019.23~20.04.1 5.15.0-1014.18~20.04.1 5.15.0-1015.19~20.04.1 5.15.0-1018.22~20.04.1 5.15.0-1027.31~20.04.1 5.15.0-1028.32~20.04.1 5.15.0-1030.34~20.04.1 5.15.0-1031.35~20.04.1 5.15.0-1033.37~20.04.1 5.15.0-1034.38~20.04.1 5.15.0-1035.39~20.04.1 5.15.0-1036.40~20.04.1 5.15.0-1037.41~20.04.1 5.15.0-1038.43~20.04.1 5.15.0-1039.44~20.04.1 5.15.0-1040.45~20.04.1 5.15.0-1041.46~20.04.1 5.15.0-1043.48~20.04.1 5.15.0-1044.49~20.04.1 5.15.0-1045.50~20.04.1 5.15.0-1047.52~20.04.1 5.15.0-1048.53~20.04.1 5.15.0-1049.54~20.04.1 5.15.0-1050.55~20.04.1 5.15.0-1051.56~20.04.1 5.15.0-1052.57~20.04.1 5.15.0-1053.58~20.04.1 5.15.0-1055.60~20.04.1 5.15.0-1056.61~20.04.1 5.15.0-1057.63~20.04.1 5.15.0-1058.64~20.04.1 5.15.0-1061.67~20.04.1 5.15.0-1062.68~20.04.1 5.15.0-1063.69~20.04.1 5.15.0-1064.70~20.04.1 5.15.0-1065.71~20.04.1 5.15.0-1066.72~20.04.1
Released
Ubuntu 20.04 HWE Azure
5.15.0-1029.36~20.04.1 show all hide all
5.15.0-1022.27~20.04.1 5.15.0-1023.29~20.04.1 5.15.0-1021.26~20.04.1 5.15.0-1020.25~20.04.1 5.15.0-1017.20~20.04.1 5.15.0-1019.24~20.04.1 5.15.0-1008.9~20.04.1 5.15.0-1013.16~20.04.1 5.15.0-1014.17~20.04.1 5.15.0-1024.30~20.04.1 5.15.0-1034.41~20.04.1 5.15.0-1049.56~20.04.1 5.15.0-1050.57~20.04.1 5.15.0-1054.62~20.04.1 5.15.0-1056.64~20.04.1 5.15.0-1057.65~20.04.1 5.15.0-1058.66~20.04.2 5.15.0-1059.67~20.04.1 5.15.0-1060.69~20.04.1 5.15.0-1061.70~20.04.1 5.15.0-1063.72~20.04.1 5.15.0-1064.73~20.04.1 5.15.0-1067.76~20.04.1 5.15.0-1068.77~20.04.1 5.15.0-1065.74~20.04.1
Released
Ubuntu 20.04 GCP
In Progress
Debian 12
Planned
Ubuntu 24.04
Planned