Vulnerability · Published Jul 30, 2024 · Assigned by Linux
CVE-2024-42106inet_diag: Initialize pad field in struct inet_diag_req_v2
Medium 5.5
In plain English
A medium-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.3% (higher than 19% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: inet_diag: Initialize pad field in struct inet_diag_req_v2 KMSAN reported uninit-value access in raw_lookup() [1]. Diag for raw sockets uses the pad field in struct inet_diag_req_v2 for the underlying protocol. This field corresponds to the sdiag_raw_protocol field in struct inet_diag_req_raw. inet_diag_get_exact_compat() converts inet_diag_req to inet_diag_req_v2, but leaves the pad field uninitialized. So the issue occurs when raw_lookup() accesses the sdiag_raw_protocol field. Fix this by initializing the pad field in inet_diag_get_exact_compat(). Also, do the same fix in inet_diag_dump_compat() to avoid the similar issue in the future. [1] BUG: KMSAN: uninit-value in raw_lookup net/ipv4/raw_diag.c:49 [inline] BUG: KMSAN: uninit-value in raw_sock_get+0x657/0x800 net/ipv4/raw_diag.c:71 raw_lookup net/ipv4/raw_diag.c:49 [inline] raw_sock_get+0x657/0x800 net/ipv4/raw_diag.c:71 raw_diag_dump_one+0xa1/0x660 net/ipv4/raw_diag.c:99 inet_diag_cmd_exact+0x7d9/0x980 inet_diag_get_exact_compat net/ipv4/inet_diag.c:1404 [inline] inet_diag_rcv_msg_compat+0x469/0x530 net/ipv4/inet_diag.c:1426 sock_diag_rcv_msg+0x23d/0x740 net/core/sock_diag.c:282 netlink_rcv_skb+0x537/0x670 net/netlink/af_netlink.c:2564 sock_diag_rcv+0x35/0x40 net/core/sock_diag.c:297 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0xe74/0x1240 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x10c6/0x1260 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x332/0x3d0 net/socket.c:745 ____sys_sendmsg+0x7f0/0xb70 net/socket.c:2585 ___sys_sendmsg+0x271/0x3b0 net/socket.c:2639 __sys_sendmsg net/socket.c:2668 [inline] __do_sys_sendmsg net/socket.c:2677 [inline] __se_sys_sendmsg net/socket.c:2675 [inline] __x64_sys_sendmsg+0x27e/0x4a0 net/socket.c:2675 x64_sys_call+0x135e/0x3ce0 arch/x86/include/generated/asm/syscalls_64.h:47 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd9/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Uninit was stored to memory at: raw_sock_get+0x650/0x800 net/ipv4/raw_diag.c:71 raw_diag_dump_one+0xa1/0x660 net/ipv4/raw_diag.c:99 inet_diag_cmd_exact+0x7d9/0x980 inet_diag_get_exact_compat net/ipv4/inet_diag.c:1404 [inline] inet_diag_rcv_msg_compat+0x469/0x530 net/ipv4/inet_diag.c:1426 sock_diag_rcv_msg+0x23d/0x740 net/core/sock_diag.c:282 netlink_rcv_skb+0x537/0x670 net/netlink/af_netlink.c:2564 sock_diag_rcv+0x35/0x40 net/core/sock_diag.c:297 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0xe74/0x1240 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x10c6/0x1260 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x332/0x3d0 net/socket.c:745 ____sys_sendmsg+0x7f0/0xb70 net/socket.c:2585 ___sys_sendmsg+0x271/0x3b0 net/socket.c:2639 __sys_sendmsg net/socket.c:2668 [inline] __do_sys_sendmsg net/socket.c:2677 [inline] __se_sys_sendmsg net/socket.c:2675 [inline] __x64_sys_sendmsg+0x27e/0x4a0 net/socket.c:2675 x64_sys_call+0x135e/0x3ce0 arch/x86/include/generated/asm/syscalls_64.h:47 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd9/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Local variable req.i created at: inet_diag_get_exact_compat net/ipv4/inet_diag.c:1396 [inline] inet_diag_rcv_msg_compat+0x2a6/0x530 net/ipv4/inet_diag.c:1426 sock_diag_rcv_msg+0x23d/0x740 net/core/sock_diag.c:282 CPU: 1 PID: 8888 Comm: syz-executor.6 Not tainted 6.10.0-rc4-00217-g35bb670d65fc #32 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.98-1 | DEBIAN-CVE-2024-42106 |
| Debian:13 | linux | 6.9.9-1 | DEBIAN-CVE-2024-42106 |
| Debian:14 | linux | 6.9.9-1 | DEBIAN-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux | 5.15.0-121.131 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux | 6.8.0-48.48 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1069.75 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1018.20 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1018.19~22.04.1 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1072.81 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1017.20 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1017.20~22.04.1 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1072.81.1 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1068.76 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1017.19 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1017.19~22.04.1 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1066.72 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1013.17 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1052.59 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1002.4 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-48.48~22.04.1 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1062.65 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1015.15 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1015.15~22.04.1 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1064.70 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1066.71 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-121.131 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-48.48.3 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-48.48.3~22.04.1 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1064.65 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1017.19 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1017.19~22.04.1 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1017.19.1 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1028.28 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1016.16 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1016.16 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1067.73 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1015.16 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1015.15~22.04.1 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1062.65 | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1014.16 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-48.48.1 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-48.48.1~22.04.2 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-42106 |
| Ubuntu:24.04:LTS | linux-xilinx | 6.8.0-1009.10 | UBUNTU-CVE-2024-42106 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 5.15.0-1035.39 | UBUNTU-CVE-2024-42106 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 432490f9d455fb842d70219f22d9d2c812371676 – before 7094a5fd20ab66028f1da7f06e0f2692d70346f9432490f9d455fb842d70219f22d9d2c812371676 – before 0184bf0a349f4cf9e663abbe862ff280e8e4dfa2432490f9d455fb842d70219f22d9d2c812371676 – before 7ef519c8efde152e0d632337f2994f6921e0b7e4432490f9d455fb842d70219f22d9d2c812371676 – before 8366720519ea8d322a20780debdfd23d9fc0904a432490f9d455fb842d70219f22d9d2c812371676 – before d6f487e0704de2f2d15f8dd5d7d723210f2b2fdb432490f9d455fb842d70219f22d9d2c812371676 – before 76965648fe6858db7c5f3c700fef7aa5f124ca1c432490f9d455fb842d70219f22d9d2c812371676 – before f9b2010e8af49fac9d9562146fb81744d8a9b051432490f9d455fb842d70219f22d9d2c812371676 – before 61cf1c739f08190a4cbf047b9fbb192a94d87e3f |
| Linux | Linux | 4.10 |
References
- https://git.kernel.org/stable/c/7094a5fd20ab66028f1da7f06e0f2692d70346f9
- https://git.kernel.org/stable/c/0184bf0a349f4cf9e663abbe862ff280e8e4dfa2
- https://git.kernel.org/stable/c/7ef519c8efde152e0d632337f2994f6921e0b7e4
- https://git.kernel.org/stable/c/8366720519ea8d322a20780debdfd23d9fc0904a
- https://git.kernel.org/stable/c/d6f487e0704de2f2d15f8dd5d7d723210f2b2fdb
- https://git.kernel.org/stable/c/76965648fe6858db7c5f3c700fef7aa5f124ca1c
- https://git.kernel.org/stable/c/f9b2010e8af49fac9d9562146fb81744d8a9b051
- https://git.kernel.org/stable/c/61cf1c739f08190a4cbf047b9fbb192a94d87e3f
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html
- https://cert-portal.siemens.com/productcert/html/ssa-613116.html