diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2024-02-02 19:32:20 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-01 15:35:05 +0300 |
commit | f053322543504014c06bd2276f4586b62edd01b4 (patch) | |
tree | 005dd07c622846ba399307518283c5346050ea0b /certs | |
parent | 0f7798768f21b41e4572f8d486fb197d3b622ede (diff) | |
download | linux-f053322543504014c06bd2276f4586b62edd01b4.tar.xz |
xsk: Add truesize to skb_add_rx_frag().
[ Upstream commit 2127c604383666675789fd4a5fc2aead46c73aad ]
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: cf24f5a5feea ("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>
Diffstat (limited to 'certs')
0 files changed, 0 insertions, 0 deletions