]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xsk: Extend xsk_rcv_check validation
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 15 Jan 2026 08:25:54 +0000 (09:25 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 20 Jan 2026 10:58:50 +0000 (11:58 +0100)
commit1ecea95dd3b524e36b344dc41895ba5051653925
tree589a965f46215a8ad9abf6f48acf564f25ed1f44
parent804bf334d08aeceda1c39f4e26d7eda802b63a33
xsk: Extend xsk_rcv_check validation

xsk_rcv_check tests for inbound packets to see whether they match
the bound AF_XDP socket. Refactor the test into a small helper
xsk_dev_queue_valid and move the validation against xs->dev and
xs->queue_id there.

The fast-path case stays in place and allows for quick return in
xsk_dev_queue_valid. If it fails, the validation is extended to
check whether the AF_XDP socket is bound against a leased queue,
and if the case then the test is redone.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Co-developed-by: David Wei <dw@davidwei.uk>
Signed-off-by: David Wei <dw@davidwei.uk>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20260115082603.219152-8-daniel@iogearbox.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/xdp/xsk.c