]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sctp: fix missing encap_port propagation for GSO fragments
authorXin Long <lucien.xin@gmail.com>
Sun, 12 Apr 2026 18:13:51 +0000 (14:13 -0400)
committerJakub Kicinski <kuba@kernel.org>
Mon, 13 Apr 2026 23:49:37 +0000 (16:49 -0700)
encap_port in SCTP_INPUT_CB(skb) is used by sctp_vtag_verify() for
SCTP-over-UDP processing. In the GSO case, it is only set on the head
skb, while fragment skbs leave it 0.

This results in fragment skbs seeing encap_port == 0, breaking
SCTP-over-UDP connections.

Fix it by propagating encap_port from the head skb cb when initializing
fragment skbs in sctp_inq_pop().

Fixes: 046c052b475e ("sctp: enable udp tunneling socks")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Link: https://patch.msgid.link/ea65ed61b3598d8b4940f0170b9aa1762307e6c3.1776017631.git.lucien.xin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sctp/inqueue.c

index f5a7d5a38755551c99bd74cd677935982cc0155e..a024c08432471d285e1e0c947892d1bf7cff9bb2 100644 (file)
@@ -201,6 +201,7 @@ new_skb:
 
                        cb->chunk = head_cb->chunk;
                        cb->af = head_cb->af;
+                       cb->encap_port = head_cb->encap_port;
                }
        }