Skip to content

Conversation

@roxanan1996
Copy link

DESCRIPTION

Commit "sctp: linearize cloned gso packets in sctp_rcv" is the fix and it was a clean cherry-pick.

Note: Diff between commits with bigger context may show extra changes, due to missing:
0af03170637f47fb5cc6501d4b2dcbf1c14772a9 sctp: add dif and sdif check in asoc and ep lookup
but it's not relevant to this CVE.

Screenshot From 2025-10-30 11-44-34

COMMITS

sctp: linearize cloned gso packets in sctp_rcv

jira VULN-136341
cve CVE-2025-38718
commit-author Xin Long <lucien.xin@gmail.com>
commit fd60d8a086191fe33c2d719732d2482052fa6805

TESTING

BUILD

> grep -E -B 5 -A 5 '\[TIMER\]|^Starting Build' /home/rnicolescu/ciq/test/kernels/lts-9.2/kernel-build-after.log
  CLEAN   scripts/mod
  CLEAN   scripts/selinux/genheaders
  CLEAN   scripts/selinux/mdp
  CLEAN   scripts
  CLEAN   include/config include/generated arch/x86/include/generated .config .config.old .version Module.symvers certs/signing_key.pem certs/signing_key.x509 certs/x509.genkey
[TIMER]{MRPROPER}: 6s
x86_64 architecture detected, copying config
'configs/kernel-x86_64-rhel.config' -> '.config'
Setting Local Version for build
CONFIG_LOCALVERSION="-rnicolescu_ciqlts9_2-9a2d88141d21"
Making olddefconfig
--
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
Starting Build
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
  SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
  SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
--
  BTF [M] sound/usb/usx2y/snd-usb-usx2y.ko
  BTF [M] sound/virtio/virtio_snd.ko
  BTF [M] sound/x86/snd-hdmi-lpe-audio.ko
  BTF [M] virt/lib/irqbypass.ko
  BTF [M] sound/xen/snd_xen_front.ko
[TIMER]{BUILD}: 1631s
Making Modules
  INSTALL /lib/modules/5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+/kernel/arch/x86/crypto/blake2s-x86_64.ko
  INSTALL /lib/modules/5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+/kernel/arch/x86/crypto/blowfish-x86_64.ko
  INSTALL /lib/modules/5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+/kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko
  INSTALL /lib/modules/5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+/kernel/arch/x86/crypto/camellia-x86_64.ko
--
  SIGN    /lib/modules/5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+/kernel/sound/virtio/virtio_snd.ko
  SIGN    /lib/modules/5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+/kernel/sound/xen/snd_xen_front.ko
  STRIP   /lib/modules/5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+/kernel/drivers/hid/hid-roccat-arvo.ko
  SIGN    /lib/modules/5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+/kernel/drivers/hid/hid-roccat-arvo.ko
  DEPMOD  /lib/modules/5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+
[TIMER]{MODULES}: 13s
Making Install
sh ./arch/x86/boot/install.sh \
	5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+ arch/x86/boot/bzImage \
	System.map "/boot"
[TIMER]{INSTALL}: 29s
Checking kABI
kABI check passed
Setting Default Kernel to /boot/vmlinuz-5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+ and Index to 0
The default is /boot/loader/entries/2e0a31fc11a34fd1ba9b23a306440297-5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+.conf with index 0 and kernel /boot/vmlinuz-5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+
The default is /boot/loader/entries/2e0a31fc11a34fd1ba9b23a306440297-5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+.conf with index 0 and kernel /boot/vmlinuz-5.14.0-rnicolescu_ciqlts9_2-9a2d88141d21+
Generating grub configuration file ...
Adding boot menu entry for UEFI Firmware Settings ...
done
Hopefully Grub2.0 took everything ... rebooting after time metrices
[TIMER]{MRPROPER}: 6s
[TIMER]{BUILD}: 1631s
[TIMER]{MODULES}: 13s
[TIMER]{INSTALL}: 29s
[TIMER]{TOTAL} 1686s
Rebooting in 10 seconds

kernel-build-before.log
kernel-build-after.log

Kselftests

> /home/rnicolescu/ciq/kernel-tools/kselftest-diff.sh /home/rnicolescu/ciq/test/kernels/lts-9.2
/home/rnicolescu/ciq/test/kernels/lts-9.2/kselftest-before.log
307
/home/rnicolescu/ciq/test/kernels/lts-9.2/kselftest-after.log
307
Before: /home/rnicolescu/ciq/test/kernels/lts-9.2/kselftest-before.log
After: /home/rnicolescu/ciq/test/kernels/lts-9.2/kselftest-after.log
Diff:
No differences found.

kselftest-before.log
kselftest-after.log

Check_kernel_commits including interdiff

> /home/rnicolescu/ciq/kernel-src-tree-tools/check_kernel_commits.py --repo /home/rnicolescu/ciq/test/kernels/lts-9.2/kernel-src-tree --pr_branch {rnicolescu}/ciqlts9_2 --base_branch origin/ciqlts9_2
------------------
interdiff result:
No diff between 9a2d88141d21d3d4255a8b05edfc2813eb5a23c4 fd60d8a086191fe33c2d719732d2482052fa6805
All referenced commits exist upstream and have no Fixes: tags.

jira VULN-136341
cve CVE-2025-38718
commit-author Xin Long <lucien.xin@gmail.com>
commit fd60d8a

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/0x1920 net/sctp/inqueue.c:211
   sctp_inq_pop+0x15b7/0x1920 net/sctp/inqueue.c:211
   sctp_assoc_bh_rcv+0x1a7/0xc50 net/sctp/associola.c:998
   sctp_inq_push+0x2ef/0x380 net/sctp/inqueue.c:88
   sctp_backlog_rcv+0x397/0xdb0 net/sctp/input.c:331
   sk_backlog_rcv+0x13b/0x420 include/net/sock.h:1122
   __release_sock+0x1da/0x330 net/core/sock.c:3106
   release_sock+0x6b/0x250 net/core/sock.c:3660
   sctp_wait_for_connect+0x487/0x820 net/sctp/socket.c:9360
   sctp_sendmsg_to_asoc+0x1ec1/0x1f00 net/sctp/socket.c:1885
   sctp_sendmsg+0x32b9/0x4a80 net/sctp/socket.c:2031
   inet_sendmsg+0x25a/0x280 net/ipv4/af_inet.c:851
   sock_sendmsg_nosec net/socket.c:718 [inline]

and

  BUG: KMSAN: uninit-value in sctp_assoc_bh_rcv+0x34e/0xbc0 net/sctp/associola.c:987
   sctp_assoc_bh_rcv+0x34e/0xbc0 net/sctp/associola.c:987
   sctp_inq_push+0x2a3/0x350 net/sctp/inqueue.c:88
   sctp_backlog_rcv+0x3c7/0xda0 net/sctp/input.c:331
   sk_backlog_rcv+0x142/0x420 include/net/sock.h:1148
   __release_sock+0x1d3/0x330 net/core/sock.c:3213
   release_sock+0x6b/0x270 net/core/sock.c:3767
   sctp_wait_for_connect+0x458/0x820 net/sctp/socket.c:9367
   sctp_sendmsg_to_asoc+0x223a/0x2260 net/sctp/socket.c:1886
   sctp_sendmsg+0x3910/0x49f0 net/sctp/socket.c:2032
   inet_sendmsg+0x269/0x2a0 net/ipv4/af_inet.c:851
   sock_sendmsg_nosec net/socket.c:712 [inline]

This patch fixes it by linearizing cloned gso packets in sctp_rcv().

Fixes: 90017ac ("sctp: Add GSO support")
	Reported-by: syzbot+773e51afe420baaf0e2b@syzkaller.appspotmail.com
	Reported-by: syzbot+70a42f45e76bede082be@syzkaller.appspotmail.com
	Signed-off-by: Xin Long <lucien.xin@gmail.com>
	Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Link: https://patch.msgid.link/dd7dc337b99876d4132d0961f776913719f7d225.1754595611.git.lucien.xin@gmail.com
	Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit fd60d8a)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
@roxanan1996 roxanan1996 requested a review from a team October 30, 2025 13:12
Copy link
Collaborator

@bmastbergen bmastbergen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

@roxanan1996 roxanan1996 self-assigned this Oct 30, 2025
Copy link
Collaborator

@PlaidCat PlaidCat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@roxanan1996 roxanan1996 merged commit d729ef2 into ciqlts9_2 Oct 31, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants