xskmap: reject TX-only AF_XDP sockets#12035
Closed
kernel-patches-daemon-bpf[bot] wants to merge 2 commits intobpf_basefrom
Closed
xskmap: reject TX-only AF_XDP sockets#12035kernel-patches-daemon-bpf[bot] wants to merge 2 commits intobpf_basefrom
kernel-patches-daemon-bpf[bot] wants to merge 2 commits intobpf_basefrom
Conversation
Author
|
Upstream branch: 0c7ae13 |
ee9631b to
010a7e6
Compare
Author
|
Upstream branch: f3b8c28 |
3518e96 to
1f2f077
Compare
010a7e6 to
c40937c
Compare
Author
|
Upstream branch: 18fc650 |
1f2f077 to
ace76e2
Compare
Author
|
Upstream branch: 18fc650 |
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> Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
ace76e2 to
03ef138
Compare
c40937c to
bc609a5
Compare
Author
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1091677 irrelevant now. Closing PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: xskmap: reject TX-only AF_XDP sockets
version: 4
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1091677