summaryrefslogtreecommitdiff
path: root/drivers/usb/input/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2026-03-25 12:51:30 +0000
committerDavid S. Miller <davem@davemloft.net>2026-03-27 12:08:26 +0000
commit5597dd284ff8c556c0b00f6a34473677426e3f81 (patch)
tree1bb58870b10206ef751bda14a516b38f2408d115 /drivers/usb/input/git@git.tavy.me:linux.git
parentbb417456c7814d1493d98b7dd9c040bf3ce3b4ed (diff)
net: ti: icssg-prueth: fix missing data copy and wrong recycle in ZC RX dispatch
emac_dispatch_skb_zc() allocates a new skb via napi_alloc_skb() but never copies the packet data from the XDP buffer into it. The skb is passed up the stack containing uninitialized heap memory instead of the actual received packet, leaking kernel heap contents to userspace. Copy the received packet data from the XDP buffer into the skb using skb_copy_to_linear_data(). Additionally, remove the skb_mark_for_recycle() call since the skb is backed by the NAPI page frag allocator, not page_pool. Marking a non-page_pool skb for recycle causes the free path to return pages to a page_pool that does not own them, corrupting page_pool state. The non-ZC path (emac_rx_packet) does not have these issues because it uses napi_build_skb() to wrap the existing page_pool page directly, requiring no copy, and correctly marks for recycle since the page comes from page_pool_dev_alloc_pages(). Fixes: 7a64bb388df3 ("net: ti: icssg-prueth: Add AF_XDP zero copy for RX") Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/usb/input/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions