summaryrefslogtreecommitdiff
path: root/net/llc/llc_input.c
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2023-07-18 10:41:50 -0700
committerPaolo Abeni <pabeni@redhat.com>2023-07-20 10:46:28 +0200
commit97b1d320f48c21e40cc42b4ac033f2520f9ecc5c (patch)
tree801f1f2fdf0200d413a7ee741aa7e8a0893345c5 /net/llc/llc_input.c
parent9b64e93e83c2145a750e780198b41d612e3dfa5d (diff)
llc: Check netns in llc_estab_match() and llc_listener_match().
We will remove this restriction in llc_rcv() in the following patch, which means that the protocol handler must be aware of netns. if (!net_eq(dev_net(dev), &init_net)) goto drop; llc_rcv() fetches llc_type_handlers[llc_pdu_type(skb) - 1] and calls it if not NULL. If the PDU type is LLC_DEST_CONN, llc_conn_handler() is called to pass skb to corresponding sockets. Then, we must look up a proper socket in the same netns with skb->dev. llc_conn_handler() calls __llc_lookup() to look up a established or litening socket by __llc_lookup_established() and llc_lookup_listener(). Both functions iterate on a list and call llc_estab_match() or llc_listener_match() to check if the socket is the correct destination. However, these functions do not check netns. Also, bind() and connect() call llc_establish_connection(), which finally calls __llc_lookup_established(), to check if there is a conflicting socket. Let's test netns in llc_estab_match() and llc_listener_match(). Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/llc/llc_input.c')
0 files changed, 0 insertions, 0 deletions