Skip to content

Conversation

@roxanan1996
Copy link
Contributor

DESCRIPTION

Ran the cve remediation script.

One interesting case was caught by interdiff.
Commit

 "Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp"

applied cleanly, even though it's not a fix of interest.
I cherry picked

Bluetooth: L2CAP: Fix use-after-free in l2cap_disconnect_{req,rsp}

and its bf

Bluetooth: Fix l2cap_disconnect_req deadlock

and now the cve is correct.
I am not sure why this was marked as affected by this CVE when it was not in the first place.
For more details, check this in 9.2 which is the same issue I ran into
#732 (comment)

COMMITS

Bluetooth: L2CAP: Fix user-after-free

jira VULN-155528
cve CVE-2022-50386
commit-author Luiz Augusto von Dentz <[email protected]>
commit 35fcbc4243aad7e7d020b7c1dfb14bb888b20a4f
ext4: fix undefined behavior in bit shift for ext4_check_flag_values

jira VULN-155615
cve CVE-2022-50403
commit-author Gaosheng Cui <[email protected]>
commit 3bf678a0f9c017c9ba7c581541dbc8453452a7ae
wifi: mac80211: check S1G action frame size

jira VULN-154631
cve CVE-2023-53257
commit-author Johannes Berg <[email protected]>
commit 19e4a47ee74718a22e963e8a647c8c3bfe8bb05c
ip6mr: Fix skb_under_panic in ip6mr_cache_report()

jira VULN-155437
cve CVE-2023-53365
commit-author Yue Haibing <[email protected]>
commit 30e0191b16e8a58e4620fa3e2839ddc7b9d4281c
sctp: linearize cloned gso packets in sctp_rcv

jira VULN-136337
cve CVE-2025-38718
commit-author Xin Long <[email protected]>
commit fd60d8a086191fe33c2d719732d2482052fa6805
ALSA: usb-audio: Validate UAC3 power domain descriptors, too

jira VULN-136368
cve CVE-2025-38729
commit-author Takashi Iwai <[email protected]>
commit d832ccbc301fbd9e5a1d691bdcf461cdb514595f
ALSA: hda/ca0132: Fix buffer overflow in add_tuning_control

jira VULN-152894
cve CVE-2025-39751
commit-author Lucy Thrun <[email protected]>
commit a409c60111e6bb98fcabab2aeaa069daa9434ca0
Bluetooth: L2CAP: Fix use-after-free in l2cap_disconnect_{req,rsp}

jira VULN-154997
cve-pre CVE-2023-53297
commit-author Luiz Augusto von Dentz <[email protected]>
commit a2a9339e1c9deb7e1e079e12e27a0265aea8421a
Bluetooth: Fix l2cap_disconnect_req deadlock

jira VULN-154997
cve-pre CVE-2023-53297
commit-author Ying Hsu <[email protected]>
commit 02c5ea5246a44d6ffde0fddebfc1d56188052976
Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp

jira VULN-154997
cve CVE-2023-53297
commit-author Min Li <[email protected]>
commit 25e97f7b1866e6b8503be349eeea44bb52d661ce

TESTING

BUILD

> grep -E -B 5 -A 5 '\[TIMER\]|^Starting Build' /home/rnicolescu/ciq/kernels/lts-8.6/kernel-build-after.log
  CLEAN   scripts/selinux/genheaders
  CLEAN   scripts/selinux/mdp
  CLEAN   scripts
  CLEAN   include/config usr/include include/generated arch/x86/include/generated
  CLEAN   .config .config.old .version Module.symvers
[TIMER]{MRPROPER}: 6s
x86_64 architecture detected, copying config
'configs/kernel-x86_64.config' -> '.config'
Setting Local Version for build
CONFIG_LOCALVERSION="-rnicolescu_ciqlts8_6-2b85d4dbe66df"
Making olddefconfig
--
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --olddefconfig Kconfig
#
# configuration written to .config
#
Starting Build
scripts/kconfig/conf  --syncconfig Kconfig
  SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
  SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
  SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
  SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
--
  LD [M]  sound/usb/usx2y/snd-usb-usx2y.ko
  LD [M]  sound/virtio/virtio_snd.ko
  LD [M]  sound/x86/snd-hdmi-lpe-audio.ko
  LD [M]  sound/xen/snd_xen_front.ko
  LD [M]  virt/lib/irqbypass.ko
[TIMER]{BUILD}: 1379s
Making Modules
  INSTALL arch/x86/crypto/blowfish-x86_64.ko
  INSTALL arch/x86/crypto/camellia-aesni-avx-x86_64.ko
  INSTALL arch/x86/crypto/camellia-x86_64.ko
  INSTALL arch/x86/crypto/camellia-aesni-avx2.ko
--
  INSTALL sound/virtio/virtio_snd.ko
  INSTALL sound/x86/snd-hdmi-lpe-audio.ko
  INSTALL sound/xen/snd_xen_front.ko
  INSTALL virt/lib/irqbypass.ko
  DEPMOD  4.18.0-rnicolescu_ciqlts8_6-2b85d4dbe66df+
[TIMER]{MODULES}: 10s
Making Install
sh ./arch/x86/boot/install.sh 4.18.0-rnicolescu_ciqlts8_6-2b85d4dbe66df+ arch/x86/boot/bzImage \
	System.map "/boot"
[TIMER]{INSTALL}: 30s
Checking kABI
kABI check passed
Setting Default Kernel to /boot/vmlinuz-4.18.0-rnicolescu_ciqlts8_6-2b85d4dbe66df+ and Index to 2
The default is /boot/loader/entries/4af400ffbc594355b416ceb0ea100ed9-4.18.0-rnicolescu_ciqlts8_6-2b85d4dbe66df+.conf with index 2 and kernel /boot/vmlinuz-4.18.0-rnicolescu_ciqlts8_6-2b85d4dbe66df+
The default is /boot/loader/entries/4af400ffbc594355b416ceb0ea100ed9-4.18.0-rnicolescu_ciqlts8_6-2b85d4dbe66df+.conf with index 2 and kernel /boot/vmlinuz-4.18.0-rnicolescu_ciqlts8_6-2b85d4dbe66df+
Generating grub configuration file ...
done
Hopefully Grub2.0 took everything ... rebooting after time metrices
[TIMER]{MRPROPER}: 6s
[TIMER]{BUILD}: 1379s
[TIMER]{MODULES}: 10s
[TIMER]{INSTALL}: 30s
[TIMER]{TOTAL} 1430s
Rebooting in 10 seconds

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

Kselftests

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

kselftest-after.log
kselftest-before.log

Check_kernel_commits

> python3 /home/rnicolescu/ciq/kernel-src-tree-tools/check_kernel_commits.py --repo /home/rnicolescu/ciq/kernels/lts-8.6/kernel-src-tree --pr_branch {rnicolescu}_ciqlts8_6 --base_branch origin/ciqlts8_6 --check-cves
All referenced commits exist upstream and have no Fixes: tags.

Run interdiff

> python3 /home/rnicolescu/ciq/kernel-src-tree-tools/run_interdiff.py --repo /home/rnicolescu/ciq/kernels/lts-8.6/kernel-src-tree --pr_branch {rnicolescu}_ciqlts8_6 --base_branch origin/ciqlts8_6
All backported commits match their upstream counterparts.

Run jira_pr_check

> python3 /home/rnicolescu/ciq/kernel-src-tree-tools/jira_pr_check.py --kernel-src-tree /home/rnicolescu/ciq/kernels/lts-8.6/kernel-src-tree --merge-target {rnicolescu}_ciqlts8_6 --pr-branch origin/ciqlts8_6

## JIRA PR Check Results

✅ **No issues found!**


---
**Summary:** Checked 0 commit(s) total.

jira VULN-155528
cve CVE-2022-50386
commit-author Luiz Augusto von Dentz <[email protected]>
commit 35fcbc4

This uses l2cap_chan_hold_unless_zero() after calling
__l2cap_get_chan_blah() to prevent the following trace:

Bluetooth: l2cap_core.c:static void l2cap_chan_destroy(struct kref
*kref)
Bluetooth: chan 0000000023c4974d
Bluetooth: parent 00000000ae861c08
==================================================================
BUG: KASAN: use-after-free in __mutex_waiter_is_first
kernel/locking/mutex.c:191 [inline]
BUG: KASAN: use-after-free in __mutex_lock_common
kernel/locking/mutex.c:671 [inline]
BUG: KASAN: use-after-free in __mutex_lock+0x278/0x400
kernel/locking/mutex.c:729
Read of size 8 at addr ffff888006a49b08 by task kworker/u3:2/389

Link: https://lore.kernel.org/lkml/[email protected]
	Signed-off-by: Luiz Augusto von Dentz <[email protected]>
	Signed-off-by: Sungwoo Kim <[email protected]>
(cherry picked from commit 35fcbc4)
	Signed-off-by: Roxana Nicolescu <[email protected]>
jira VULN-155615
cve CVE-2022-50403
commit-author Gaosheng Cui <[email protected]>
commit 3bf678a

Shifting signed 32-bit value by 31 bits is undefined, so changing
significant bit to unsigned. The UBSAN warning calltrace like below:

UBSAN: shift-out-of-bounds in fs/ext4/ext4.h:591:2
left shift of 1 by 31 places cannot be represented in type 'int'
Call Trace:
 <TASK>
 dump_stack_lvl+0x7d/0xa5
 dump_stack+0x15/0x1b
 ubsan_epilogue+0xe/0x4e
 __ubsan_handle_shift_out_of_bounds+0x1e7/0x20c
 ext4_init_fs+0x5a/0x277
 do_one_initcall+0x76/0x430
 kernel_init_freeable+0x3b3/0x422
 kernel_init+0x24/0x1e0
 ret_from_fork+0x1f/0x30
 </TASK>

Fixes: 9a4c801 ("ext4: ensure Inode flags consistency are checked at build time")
	Signed-off-by: Gaosheng Cui <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
	Signed-off-by: Theodore Ts'o <[email protected]>
	Cc: [email protected]
(cherry picked from commit 3bf678a)
	Signed-off-by: Roxana Nicolescu <[email protected]>
jira VULN-154631
cve CVE-2023-53257
commit-author Johannes Berg <[email protected]>
commit 19e4a47

Before checking the action code, check that it even
exists in the frame.

	Reported-by: [email protected]
	Signed-off-by: Johannes Berg <[email protected]>
(cherry picked from commit 19e4a47)
	Signed-off-by: Roxana Nicolescu <[email protected]>
jira VULN-155437
cve CVE-2023-53365
commit-author Yue Haibing <[email protected]>
commit 30e0191

skbuff: skb_under_panic: text:ffffffff88771f69 len:56 put:-4
 head:ffff88805f86a800 data:ffff887f5f86a850 tail:0x88 end:0x2c0 dev:pim6reg
 ------------[ cut here ]------------
 kernel BUG at net/core/skbuff.c:192!
 invalid opcode: 0000 [#1] PREEMPT SMP KASAN
 CPU: 2 PID: 22968 Comm: kworker/2:11 Not tainted 6.5.0-rc3-00044-g0a8db05b571a #236
 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
 Workqueue: ipv6_addrconf addrconf_dad_work
 RIP: 0010:skb_panic+0x152/0x1d0
 Call Trace:
  <TASK>
  skb_push+0xc4/0xe0
  ip6mr_cache_report+0xd69/0x19b0
  reg_vif_xmit+0x406/0x690
  dev_hard_start_xmit+0x17e/0x6e0
  __dev_queue_xmit+0x2d6a/0x3d20
  vlan_dev_hard_start_xmit+0x3ab/0x5c0
  dev_hard_start_xmit+0x17e/0x6e0
  __dev_queue_xmit+0x2d6a/0x3d20
  neigh_connected_output+0x3ed/0x570
  ip6_finish_output2+0x5b5/0x1950
  ip6_finish_output+0x693/0x11c0
  ip6_output+0x24b/0x880
  NF_HOOK.constprop.0+0xfd/0x530
  ndisc_send_skb+0x9db/0x1400
  ndisc_send_rs+0x12a/0x6c0
  addrconf_dad_completed+0x3c9/0xea0
  addrconf_dad_work+0x849/0x1420
  process_one_work+0xa22/0x16e0
  worker_thread+0x679/0x10c0
  ret_from_fork+0x28/0x60
  ret_from_fork_asm+0x11/0x20

When setup a vlan device on dev pim6reg, DAD ns packet may sent on reg_vif_xmit().
reg_vif_xmit()
    ip6mr_cache_report()
        skb_push(skb, -skb_network_offset(pkt));//skb_network_offset(pkt) is 4
And skb_push declared as:
	void *skb_push(struct sk_buff *skb, unsigned int len);
		skb->data -= len;
		//0xffff88805f86a84c - 0xfffffffc = 0xffff887f5f86a850
skb->data is set to 0xffff887f5f86a850, which is invalid mem addr, lead to skb_push() fails.

Fixes: 14fb64e ("[IPV6] MROUTE: Support PIM-SM (SSM).")
	Signed-off-by: Yue Haibing <[email protected]>
	Reviewed-by: Eric Dumazet <[email protected]>
	Signed-off-by: David S. Miller <[email protected]>
(cherry picked from commit 30e0191)
	Signed-off-by: Roxana Nicolescu <[email protected]>
jira VULN-136337
cve CVE-2025-38718
commit-author Xin Long <[email protected]>
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: [email protected]
	Reported-by: [email protected]
	Signed-off-by: Xin Long <[email protected]>
	Reviewed-by: Marcelo Ricardo Leitner <[email protected]>
Link: https://patch.msgid.link/dd7dc337b99876d4132d0961f776913719f7d225.1754595611.git.lucien.xin@gmail.com
	Signed-off-by: Jakub Kicinski <[email protected]>
(cherry picked from commit fd60d8a)
	Signed-off-by: Roxana Nicolescu <[email protected]>
jira VULN-136368
cve CVE-2025-38729
commit-author Takashi Iwai <[email protected]>
commit d832ccb

UAC3 power domain descriptors need to be verified with its variable
bLength for avoiding the unexpected OOB accesses by malicious
firmware, too.

Fixes: 9a2fe9b ("ALSA: usb: initial USB Audio Device Class 3.0 support")
Reported-and-tested-by: Youngjun Lee <[email protected]>
	Cc: <[email protected]>
Link: https://patch.msgid.link/[email protected]
	Signed-off-by: Takashi Iwai <[email protected]>
(cherry picked from commit d832ccb)
	Signed-off-by: Roxana Nicolescu <[email protected]>
jira VULN-152894
cve CVE-2025-39751
commit-author Lucy Thrun <[email protected]>
commit a409c60

The 'sprintf' call in 'add_tuning_control' may exceed the 44-byte
buffer if either string argument is too long. This triggers a compiler
warning.
Replaced 'sprintf' with 'snprintf' to limit string lengths to prevent
overflow.

	Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
	Signed-off-by: Lucy Thrun <[email protected]>
Link: https://patch.msgid.link/[email protected]
	Signed-off-by: Takashi Iwai <[email protected]>
(cherry picked from commit a409c60)
	Signed-off-by: Roxana Nicolescu <[email protected]>
jira VULN-154997
cve-pre CVE-2023-53297
commit-author Luiz Augusto von Dentz <[email protected]>
commit a2a9339

Similar to commit d0be834 ("Bluetooth: L2CAP: Fix use-after-free
caused by l2cap_chan_put"), just use l2cap_chan_hold_unless_zero to
prevent referencing a channel that is about to be destroyed.

	Cc: [email protected]
	Signed-off-by: Luiz Augusto von Dentz <[email protected]>
	Signed-off-by: Min Li <[email protected]>
(cherry picked from commit a2a9339)
	Signed-off-by: Roxana Nicolescu <[email protected]>
jira VULN-154997
cve-pre CVE-2023-53297
commit-author Ying Hsu <[email protected]>
commit 02c5ea5

L2CAP assumes that the locks conn->chan_lock and chan->lock are
acquired in the order conn->chan_lock, chan->lock to avoid
potential deadlock.
For example, l2sock_shutdown acquires these locks in the order:
  mutex_lock(&conn->chan_lock)
  l2cap_chan_lock(chan)

However, l2cap_disconnect_req acquires chan->lock in
l2cap_get_chan_by_scid first and then acquires conn->chan_lock
before calling l2cap_chan_del. This means that these locks are
acquired in unexpected order, which leads to potential deadlock:
  l2cap_chan_lock(c)
  mutex_lock(&conn->chan_lock)

This patch releases chan->lock before acquiring the conn_chan_lock
to avoid the potential deadlock.

Fixes: a2a9339 ("Bluetooth: L2CAP: Fix use-after-free in l2cap_disconnect_{req,rsp}")
	Signed-off-by: Ying Hsu <[email protected]>
	Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 02c5ea5)
	Signed-off-by: Roxana Nicolescu <[email protected]>
jira VULN-154997
cve CVE-2023-53297
commit-author Min Li <[email protected]>
commit 25e97f7

conn->chan_lock isn't acquired before l2cap_get_chan_by_scid,
if l2cap_get_chan_by_scid returns NULL, then 'bad unlock balance'
is triggered.

	Reported-by: [email protected]
Link: https://lore.kernel.org/all/[email protected]/
	Signed-off-by: Min Li <[email protected]>
	Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 25e97f7)
	Signed-off-by: Roxana Nicolescu <[email protected]>
@roxanan1996 roxanan1996 requested a review from a team December 1, 2025 14:01
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 Dec 1, 2025
@roxanan1996 roxanan1996 merged commit c05d38b into ciqlts8_6 Dec 3, 2025
3 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