diff options
| author | Toke Høiland-Jørgensen <toke@redhat.com> | 2024-03-05 22:31:32 +0100 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2024-03-15 10:48:18 -0400 |
| commit | f562e4c4aab00986dde3093c4be919c3f2b85a4a (patch) | |
| tree | 08b4d1b3f8e12c927ba75d6290670747250d3623 /net | |
| parent | 02e3549492db621df5d2f1868cc1be9bd4147118 (diff) | |
| download | linux-f562e4c4aab00986dde3093c4be919c3f2b85a4a.tar.gz linux-f562e4c4aab00986dde3093c4be919c3f2b85a4a.tar.bz2 linux-f562e4c4aab00986dde3093c4be919c3f2b85a4a.zip | |
cpumap: Zero-initialise xdp_rxq_info struct before running XDP program
[ Upstream commit 2487007aa3b9fafbd2cb14068f49791ce1d7ede5 ]
When running an XDP program that is attached to a cpumap entry, we don't
initialise the xdp_rxq_info data structure being used in the xdp_buff
that backs the XDP program invocation. Tobias noticed that this leads to
random values being returned as the xdp_md->rx_queue_index value for XDP
programs running in a cpumap.
This means we're basically returning the contents of the uninitialised
memory, which is bad. Fix this by zero-initialising the rxq data
structure before running the XDP program.
Fixes: 9216477449f3 ("bpf: cpumap: Add the possibility to attach an eBPF program to cpumap")
Reported-by: Tobias Böhm <tobias@aibor.de>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/r/20240305213132.11955-1-toke@redhat.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions
