In the Linux kernel, the following vulnerability has been resolved:
sctp: linearize cloned gso packets in sctp_rcv
A cloned head skb still shares these frag skbs in fraglist with the
original head skb. It's not safe to access these frag skbs.
syzbot reported two use-of-uninitialized-memory bugs caused by this:
BUG: KMSAN: uninit-value in sctp_inq_pop+0x15b7/0x1920net/sctp/inqueue.c:211sctp_inq_pop+0x15b7/0x1920net/sctp/inqueue.c:211sctp_assoc_bh_rcv+0x1a7/0xc50net/sctp/associola.c:998sctp_inq_push+0x2ef/0x380net/sctp/inqueue.c:88sctp_backlog_rcv+0x397/0xdb0net/sctp/input.c:331sk_backlog_rcv+0x13b/0x420include/net/sock.h:1122__release_sock+0x1da/0x330net/core/sock.c:3106release_sock+0x6b/0x250net/core/sock.c:3660sctp_wait_for_connect+0x487/0x820net/sctp/socket.c:9360sctp_sendmsg_to_asoc+0x1ec1/0x1f00net/sctp/socket.c:1885sctp_sendmsg+0x32b9/0x4a80net/sctp/socket.c:2031inet_sendmsg+0x25a/0x280net/ipv4/af_inet.c:851sock_sendmsg_nosecnet/socket.c:718[inline]
and
BUG: KMSAN: uninit-value in sctp_assoc_bh_rcv+0x34e/0xbc0net/sctp/associola.c:987sctp_assoc_bh_rcv+0x34e/0xbc0net/sctp/associola.c:987sctp_inq_push+0x2a3/0x350net/sctp/inqueue.c:88sctp_backlog_rcv+0x3c7/0xda0net/sctp/input.c:331sk_backlog_rcv+0x142/0x420include/net/sock.h:1148__release_sock+0x1d3/0x330net/core/sock.c:3213release_sock+0x6b/0x270net/core/sock.c:3767sctp_wait_for_connect+0x458/0x820net/sctp/socket.c:9367sctp_sendmsg_to_asoc+0x223a/0x2260net/sctp/socket.c:1886sctp_sendmsg+0x3910/0x49f0net/sctp/socket.c:2032inet_sendmsg+0x269/0x2a0net/ipv4/af_inet.c:851sock_sendmsg_nosecnet/socket.c:712[inline]
This patch fixes it by linearizing cloned gso packets in sctp_rcv().