summaryrefslogtreecommitdiff
path: root/include/uapi/linux/tipc_netlink.h
diff options
context:
space:
mode:
authorYehyeong Lee <yhlee@isslab.korea.ac.kr>2026-07-22 21:28:17 +0900
committerJakub Kicinski <kuba@kernel.org>2026-07-23 10:59:27 -0700
commit5e9c8baee0329fbefe7c67aea945e2a07f15e98b (patch)
tree617ce3f8766920e56029663c1cbfce334f3ebd52 /include/uapi/linux/tipc_netlink.h
parent1d4da823b75e5774161951764cbad75cb6e6a75f (diff)
downloadlinux-5e9c8baee0329fbefe7c67aea945e2a07f15e98b.tar.gz
linux-5e9c8baee0329fbefe7c67aea945e2a07f15e98b.zip
net: drop_monitor: fix info leak in NET_DM_ATTR_PAYLOAD
net_dm_packet_report_fill() and net_dm_hw_packet_report_fill() open code the NET_DM_ATTR_PAYLOAD attribute to avoid zeroing the packet payload before overwriting it with skb_copy_bits(). skb_put() reserves nla_total_size(payload_len), i.e. the header plus the NLA_ALIGN() padding, but only payload_len bytes are copied in. When payload_len is not a multiple of 4 the 1-3 padding bytes are never initialized and are leaked to user space inside the netlink message. KMSAN confirms the leak for the software path when the packet payload length is not 4-byte aligned: BUG: KMSAN: kernel-infoleak in _copy_to_iter _copy_to_iter __skb_datagram_iter skb_copy_datagram_iter netlink_recvmsg sock_recvmsg __sys_recvfrom Uninit was created at: kmem_cache_alloc_node_noprof __alloc_skb net_dm_packet_work Bytes 173-175 of 176 are uninitialized Use __nla_reserve(), which sets up the attribute header and zeroes the padding, instead of open coding the attribute construction. Fixes: ca30707dee2b ("drop_monitor: Add packet alert mode") Fixes: 5e58109b1ea4 ("drop_monitor: Add support for packet alert mode for hardware drops") Suggested-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr> Link: https://patch.msgid.link/20260722122817.5548-1-yhlee@isslab.korea.ac.kr Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/uapi/linux/tipc_netlink.h')
0 files changed, 0 insertions, 0 deletions