linux-stable/net/xdp
Sebastian Andrzej Siewior f053322543 xsk: Add truesize to skb_add_rx_frag().
[ Upstream commit 2127c60438 ]

xsk_build_skb() allocates a page and adds it to the skb via
skb_add_rx_frag() and specifies 0 for truesize. This leads to a warning
in skb_add_rx_frag() with CONFIG_DEBUG_NET enabled because size is
larger than truesize.

Increasing truesize requires to add the same amount to socket's
sk_wmem_alloc counter in order not to underflow the counter during
release in the destructor (sock_wfree()).

Pass the size of the allocated page as truesize to skb_add_rx_frag().
Add this mount to socket's sk_wmem_alloc counter.

Fixes: cf24f5a5fe ("xsk: add support for AF_XDP multi-buffer on Tx path")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/bpf/20240202163221.2488589-1-bigeasy@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-01 13:35:05 +01:00
..
Kconfig
Makefile
xdp_umem.c mm/gup: remove vmas parameter from pin_user_pages() 2023-06-09 16:25:26 -07:00
xdp_umem.h
xsk.c xsk: Add truesize to skb_add_rx_frag(). 2024-03-01 13:35:05 +01:00
xsk.h
xsk_buff_pool.c xsk: make xsk_buff_pool responsible for clearing xdp_buff::flags 2024-01-31 16:19:04 -08:00
xsk_diag.c xsk: Fix xsk_diag use-after-free error during socket cleanup 2023-08-31 13:21:11 +02:00
xsk_queue.c xdp: Fix zero-size allocation warning in xskq_create() 2023-10-09 16:13:29 +02:00
xsk_queue.h xsk: support ZC Tx multi-buffer in batch API 2023-07-19 09:56:50 -07:00
xskmap.c bpf: Centralize permissions checks for all BPF map types 2023-06-19 14:04:04 +02:00