diff options
| author | 2026-05-02 23:07:20 +0300 | |
|---|---|---|
| committer | 2026-05-05 19:27:50 -0700 | |
| commit | 8c2cff50afdd2b53c7cc2ca2297301c0ffd3e802 (patch) | |
| tree | be02987c00f1fd7c7a7737dc6f7da6c470dbf5d7 /tools/testing/ktest/examples/include/ssh:/git@git.zx2c4.com/git: | |
| parent | xsk: prevent CQ desync when freeing half-built skbs in xsk_build_skb() (diff) | |
xsk: avoid skb leak in XDP_TX_METADATA case
Fix it by explicitly adding kfree_skb() before returning back to its
caller.
How to reproduce it in virtio_net:
1. the current skb is the first one (which means no frag and xs->skb is
NULL) and users enable metadata feature.
2. xsk_skb_metadata() returns a error code.
3. the caller xsk_build_skb() clears skb by using 'skb = NULL;'.
4. there is no chance to free this skb anymore.
Closes: https://lore.kernel.org/all/20260415085204.3F87AC19424@smtp.kernel.org/
Fixes: 30c3055f9c0d ("xsk: wrap generic metadata handling onto separate function")
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Signed-off-by: Jason Xing <kernelxing@tencent.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Link: https://patch.msgid.link/20260502200722.53960-7-kerneljasonxing@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/ktest/examples/include/ssh:/git@git.zx2c4.com/git:')
0 files changed, 0 insertions, 0 deletions
