Skip to content

xskmap: reject TX-only AF_XDP sockets#11974

Closed
kernel-patches-daemon-bpf[bot] wants to merge 1 commit into
bpf-next_basefrom
series/1086843=>bpf-next
Closed

xskmap: reject TX-only AF_XDP sockets#11974
kernel-patches-daemon-bpf[bot] wants to merge 1 commit into
bpf-next_basefrom
series/1086843=>bpf-next

Conversation

@kernel-patches-daemon-bpf

Copy link
Copy Markdown

Pull request for series with
subject: xskmap: reject TX-only AF_XDP sockets
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1086843

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: cfeddb4
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1086843
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: 9f5b3ff
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1086843
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: 2ca6723
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1086843
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: 2ca6723
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1086843
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: 2ca6723
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1086843
version: 3

XSKMAP entries are used as redirect targets for incoming XDP frames.
A TX-only AF_XDP socket lacks an Rx ring and cannot handle redirected
traffic, but xsk_map_update_elem() currently allows such sockets to
be inserted into the map.

Redirecting packets to such a socket on the veth generic-XDP path
causes a kernel crash in xsk_generic_rcv().

This became possible after xsk_is_setup_for_bpf_map() was removed from
the XSKMAP update path, which allowed bound TX-only sockets to be
inserted into the map.

Reject TX-only sockets during XSKMAP updates to avoid the crash.
They remain fully operational for pure Tx purposes outside XSKMAP.

Fixes: 968be23 ("xsk: Fix possible segfault at xskmap entry insertion")
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Signed-off-by: Yifan Wu <yifanwucs@gmail.com>
Signed-off-by: Linpu Yu <linpu5433@gmail.com>
@kernel-patches-daemon-bpf kernel-patches-daemon-bpf Bot force-pushed the series/1086843=>bpf-next branch from 7d353cb to 471ec17 Compare May 2, 2026 16:06
@kernel-patches-daemon-bpf kernel-patches-daemon-bpf Bot deleted the series/1086843=>bpf-next branch May 10, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant