xsk: Skip polling event check for unbound socket
authorYewon Choi <woni9911@gmail.com>
Fri, 1 Dec 2023 06:10:52 +0000 (15:10 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:45:06 +0000 (18:45 +0100)
commitd7666bfd788418af70da8672fbe6a763d8868e20
tree7da096d3b2dc88b9059c495a958ec4631a53ac46
parente1fbdef91b1ceb3f98afc47fda725f92a6255b27
xsk: Skip polling event check for unbound socket

[ Upstream commit e4d008d49a7135214e0ee70537405b6a069e3a3f ]

In xsk_poll(), checking available events and setting mask bits should
be executed only when a socket has been bound. Setting mask bits for
unbound socket is meaningless.

Currently, it checks events even when xsk_check_common() failed.
To prevent this, we move goto location (skip_tx) after that checking.

Fixes: 1596dae2f17e ("xsk: check IFF_UP earlier in Tx path")
Signed-off-by: Yewon Choi <woni9911@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/20231201061048.GA1510@libra05
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/xdp/xsk.c