diff options
| author | Toke Høiland-Jørgensen <[email protected]> | 2024-10-30 10:48:26 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2024-10-31 15:15:21 +0000 |
| commit | c40dd8c4732551605712985bc5b7045094c6458d (patch) | |
| tree | 3e4325ec9143b9a62717f0c092f756d7fc1a4c12 /net/sched/cls_api.c | |
| parent | Merge branch 'fixes-for-bits-iterator' (diff) | |
| download | kernel-c40dd8c4732551605712985bc5b7045094c6458d.tar.gz kernel-c40dd8c4732551605712985bc5b7045094c6458d.zip | |
bpf, test_run: Fix LIVE_FRAME frame update after a page has been recycled
The test_run code detects whether a page has been modified and
re-initialises the xdp_frame structure if it has, using
xdp_update_frame_from_buff(). However, xdp_update_frame_from_buff()
doesn't touch frame->mem, so that wasn't correctly re-initialised, which
led to the pages from page_pool not being returned correctly. Syzbot
noticed this as a memory leak.
Fix this by also copying the frame->mem structure when re-initialising
the frame, like we do on initialisation of a new page from page_pool.
Fixes: e5995bc7e2ba ("bpf, test_run: fix crashes due to XDP frame overwriting/corruption")
Fixes: b530e9e1063e ("bpf: Add "live packet" mode for XDP in BPF_PROG_RUN")
Reported-by: [email protected]
Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Tested-by: [email protected]
Reviewed-by: Alexander Lobakin <[email protected]>
Acked-by: Stanislav Fomichev <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'net/sched/cls_api.c')
0 files changed, 0 insertions, 0 deletions
