CVE-2024-26805
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
04/04/2024
Last modified:
27/02/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
netlink: Fix kernel-infoleak-after-free in __skb_datagram_iter<br />
<br />
syzbot reported the following uninit-value access issue [1]:<br />
<br />
netlink_to_full_skb() creates a new `skb` and puts the `skb->data`<br />
passed as a 1st arg of netlink_to_full_skb() onto new `skb`. The data<br />
size is specified as `len` and passed to skb_put_data(). This `len`<br />
is based on `skb->end` that is not data offset but buffer offset. The<br />
`skb->end` contains data and tailroom. Since the tailroom is not<br />
initialized when the new `skb` created, KMSAN detects uninitialized<br />
memory area when copying the data.<br />
<br />
This patch resolved this issue by correct the len from `skb->end` to<br />
`skb->len`, which is the actual data offset.<br />
<br />
BUG: KMSAN: kernel-infoleak-after-free in instrument_copy_to_user include/linux/instrumented.h:114 [inline]<br />
BUG: KMSAN: kernel-infoleak-after-free in copy_to_user_iter lib/iov_iter.c:24 [inline]<br />
BUG: KMSAN: kernel-infoleak-after-free in iterate_ubuf include/linux/iov_iter.h:29 [inline]<br />
BUG: KMSAN: kernel-infoleak-after-free in iterate_and_advance2 include/linux/iov_iter.h:245 [inline]<br />
BUG: KMSAN: kernel-infoleak-after-free in iterate_and_advance include/linux/iov_iter.h:271 [inline]<br />
BUG: KMSAN: kernel-infoleak-after-free in _copy_to_iter+0x364/0x2520 lib/iov_iter.c:186<br />
instrument_copy_to_user include/linux/instrumented.h:114 [inline]<br />
copy_to_user_iter lib/iov_iter.c:24 [inline]<br />
iterate_ubuf include/linux/iov_iter.h:29 [inline]<br />
iterate_and_advance2 include/linux/iov_iter.h:245 [inline]<br />
iterate_and_advance include/linux/iov_iter.h:271 [inline]<br />
_copy_to_iter+0x364/0x2520 lib/iov_iter.c:186<br />
copy_to_iter include/linux/uio.h:197 [inline]<br />
simple_copy_to_iter+0x68/0xa0 net/core/datagram.c:532<br />
__skb_datagram_iter+0x123/0xdc0 net/core/datagram.c:420<br />
skb_copy_datagram_iter+0x5c/0x200 net/core/datagram.c:546<br />
skb_copy_datagram_msg include/linux/skbuff.h:3960 [inline]<br />
packet_recvmsg+0xd9c/0x2000 net/packet/af_packet.c:3482<br />
sock_recvmsg_nosec net/socket.c:1044 [inline]<br />
sock_recvmsg net/socket.c:1066 [inline]<br />
sock_read_iter+0x467/0x580 net/socket.c:1136<br />
call_read_iter include/linux/fs.h:2014 [inline]<br />
new_sync_read fs/read_write.c:389 [inline]<br />
vfs_read+0x8f6/0xe00 fs/read_write.c:470<br />
ksys_read+0x20f/0x4c0 fs/read_write.c:613<br />
__do_sys_read fs/read_write.c:623 [inline]<br />
__se_sys_read fs/read_write.c:621 [inline]<br />
__x64_sys_read+0x93/0xd0 fs/read_write.c:621<br />
do_syscall_x64 arch/x86/entry/common.c:52 [inline]<br />
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83<br />
entry_SYSCALL_64_after_hwframe+0x63/0x6b<br />
<br />
Uninit was stored to memory at:<br />
skb_put_data include/linux/skbuff.h:2622 [inline]<br />
netlink_to_full_skb net/netlink/af_netlink.c:181 [inline]<br />
__netlink_deliver_tap_skb net/netlink/af_netlink.c:298 [inline]<br />
__netlink_deliver_tap+0x5be/0xc90 net/netlink/af_netlink.c:325<br />
netlink_deliver_tap net/netlink/af_netlink.c:338 [inline]<br />
netlink_deliver_tap_kernel net/netlink/af_netlink.c:347 [inline]<br />
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]<br />
netlink_unicast+0x10f1/0x1250 net/netlink/af_netlink.c:1368<br />
netlink_sendmsg+0x1238/0x13d0 net/netlink/af_netlink.c:1910<br />
sock_sendmsg_nosec net/socket.c:730 [inline]<br />
__sock_sendmsg net/socket.c:745 [inline]<br />
____sys_sendmsg+0x9c2/0xd60 net/socket.c:2584<br />
___sys_sendmsg+0x28d/0x3c0 net/socket.c:2638<br />
__sys_sendmsg net/socket.c:2667 [inline]<br />
__do_sys_sendmsg net/socket.c:2676 [inline]<br />
__se_sys_sendmsg net/socket.c:2674 [inline]<br />
__x64_sys_sendmsg+0x307/0x490 net/socket.c:2674<br />
do_syscall_x64 arch/x86/entry/common.c:52 [inline]<br />
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83<br />
entry_SYSCALL_64_after_hwframe+0x63/0x6b<br />
<br />
Uninit was created at:<br />
free_pages_prepare mm/page_alloc.c:1087 [inline]<br />
free_unref_page_prepare+0xb0/0xa40 mm/page_alloc.c:2347<br />
free_unref_page_list+0xeb/0x1100 mm/page_alloc.c:2533<br />
release_pages+0x23d3/0x2410 mm/swap.c:1042<br />
free_pages_and_swap_cache+0xd9/0xf0 mm/swap_state.c:316<br />
tlb_batch_pages<br />
---truncated---
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
CPE | From | Up to |
---|---|---|
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 3.12.49 (including) | 3.13 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 3.14.54 (including) | 3.15 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 3.18.23 (including) | 3.19 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.1.10 (including) | 4.2 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.2.3 (including) | 4.19.309 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.20 (including) | 5.4.271 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.5 (including) | 5.10.212 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.151 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 6.1.81 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.21 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.7.9 (excluding) |
cpe:2.3:o:linux:linux_kernel:6.8:rc1:*:*:*:*:*:* | ||
cpe:2.3:o:linux:linux_kernel:6.8:rc2:*:*:*:*:*:* | ||
cpe:2.3:o:linux:linux_kernel:6.8:rc3:*:*:*:*:*:* | ||
cpe:2.3:o:linux:linux_kernel:6.8:rc4:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/0b27bf4c494d61e5663baa34c3edd7ccebf0ea44
- https://git.kernel.org/stable/c/59fc3e3d049e39e7d0d271f20dd5fb47c57faf1d
- https://git.kernel.org/stable/c/661779e1fcafe1b74b3f3fe8e980c1e207fea1fd
- https://git.kernel.org/stable/c/9ae51361da43270f4ba0eb924427a07e87e48777
- https://git.kernel.org/stable/c/c71ed29d15b1a1ed6c464f8c3536996963046285
- https://git.kernel.org/stable/c/d3ada42e534a83b618bbc1e490d23bf0fdae4736
- https://git.kernel.org/stable/c/ec343a55b687a452f5e87f3b52bf9f155864df65
- https://git.kernel.org/stable/c/f19d1f98e60e68b11fc60839105dd02a30ec0d77
- https://git.kernel.org/stable/c/0b27bf4c494d61e5663baa34c3edd7ccebf0ea44
- https://git.kernel.org/stable/c/59fc3e3d049e39e7d0d271f20dd5fb47c57faf1d
- https://git.kernel.org/stable/c/661779e1fcafe1b74b3f3fe8e980c1e207fea1fd
- https://git.kernel.org/stable/c/9ae51361da43270f4ba0eb924427a07e87e48777
- https://git.kernel.org/stable/c/c71ed29d15b1a1ed6c464f8c3536996963046285
- https://git.kernel.org/stable/c/d3ada42e534a83b618bbc1e490d23bf0fdae4736
- https://git.kernel.org/stable/c/ec343a55b687a452f5e87f3b52bf9f155864df65
- https://git.kernel.org/stable/c/f19d1f98e60e68b11fc60839105dd02a30ec0d77
- https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html
- https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html