]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xsk: Extend xsk_rcv_check validation
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 2 Apr 2026 23:10:25 +0000 (01:10 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 10 Apr 2026 01:21:46 +0000 (18:21 -0700)
commit9368397fb92ac95a0495cd73b5e3194ade6b883d
tree54cf3ef7a9a59343c6c3672c0f0b56405990b8c3
parent222b5566a02dbf136291376e4aa1806213fe9fa2
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 so, 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/20260402231031.447597-9-daniel@iogearbox.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/xdp/xsk.c