CVE-2024-44946: kcm: Serialise kcm_sendmsg() for the same socket.

Published Aug 31, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

kcm: Serialise kcmsendmsg() for the same socket.

syzkaller reported UAF in kcmrelease(). [0]

The scenario is

1. Thread A builds a skb with MSGMORE and sets kcm->seqskb.

2. Thread A resumes building skb from kcm->seqskb but is blocked by skstreamwaitmemory()

3. Thread B calls sendmsg() concurrently, finishes building kcm->seqskb and puts the skb to the write queue

4. Thread A faces an error and finally frees skb that is already in the write queue

5. kcmrelease() does double-free the skb in the write queue

When a thread is building a MSGMORE skb, another thread must not touch it.

Let's add a per-sk mutex and serialise kcmsendmsg().

[0]: BUG: KASAN: slab-use-after-free in skbunlink include/linux/skbuff.h:2366 [inline] BUG: KASAN: slab-use-after-free in skbdequeue include/linux/skbuff.h:2385 [inline] BUG: KASAN: slab-use-after-free in skbqueuepurgereason include/linux/skbuff.h:3175 [inline] BUG: KASAN: slab-use-after-free in skbqueuepurge include/linux/skbuff.h:3181 [inline] BUG: KASAN: slab-use-after-free in kcmrelease+0x170/0x4c8 net/kcm/kcmsock.c:1691 Read of size 8 at addr ffff0000ced0fc80 by task syz-executor329/6167

CPU: 1 PID: 6167 Comm: syz-executor329 Tainted: G B 6.8.0-rc5-syzkaller-g9abbc24128bc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Call trace: dumpbacktrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:291 showstack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:298 dumpstack lib/dumpstack.c:88 [inline] dumpstacklvl+0xd0/0x124 lib/dumpstack.c:106 printaddressdescription mm/kasan/report.c:377 [inline] printreport+0x178/0x518 mm/kasan/report.c:488 kasanreport+0xd8/0x138 mm/kasan/report.c:601 asanreportload8noabort+0x20/0x2c mm/kasan/reportgeneric.c:381 skbunlink include/linux/skbuff.h:2366 [inline] skbdequeue include/linux/skbuff.h:2385 [inline] skbqueuepurgereason include/linux/skbuff.h:3175 [inline] skbqueuepurge include/linux/skbuff.h:3181 [inline] kcmrelease+0x170/0x4c8 net/kcm/kcmsock.c:1691 sockrelease net/socket.c:659 [inline] sockclose+0xa4/0x1e8 net/socket.c:1421 fput+0x30c/0x738 fs/filetable.c:376 fput+0x20/0x30 fs/filetable.c:404 taskworkrun+0x230/0x2e0 kernel/taskwork.c:180 exittaskwork include/linux/taskwork.h:38 [inline] doexit+0x618/0x1f64 kernel/exit.c:871 dogroupexit+0x194/0x22c kernel/exit.c:1020 getsignal+0x1500/0x15ec kernel/signal.c:2893 dosignal+0x23c/0x3b44 arch/arm64/kernel/signal.c:1249 donotifyresume+0x74/0x1f4 arch/arm64/kernel/entry-common.c:148 exittousermodeprepare arch/arm64/kernel/entry-common.c:169 [inline] exittousermode arch/arm64/kernel/entry-common.c:178 [inline] el0svc+0xac/0x168 arch/arm64/kernel/entry-common.c:713 el0t64synchandler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t64sync+0x190/0x194 arch/arm64/kernel/entry.S:598

Allocated by task 6166: kasansavestack mm/kasan/common.c:47 [inline] kasansavetrack+0x40/0x78 mm/kasan/common.c:68 kasansaveallocinfo+0x70/0x84 mm/kasan/generic.c:626 unpoisonslabobject mm/kasan/common.c:314 [inline] kasanslaballoc+0x74/0x8c mm/kasan/common.c:340 kasanslaballoc include/linux/kasan.h:201 [inline] slabpostallochook mm/slub.c:3813 [inline] slaballocnode mm/slub.c:3860 [inline] kmemcacheallocnode+0x204/0x4c0 mm/slub.c:3903 allocskb+0x19c/0x3d8 net/core/skbuff.c:641 allocskb include/linux/skbuff.h:1296 [inline] kcmsendmsg+0x1d3c/0x2124 net/kcm/kcmsock.c:783 socksendmsgnosec net/socket.c:730 [inline] socksendmsg net/socket.c:745 [inline] socksendmsg+0x220/0x2c0 net/socket.c:768 splicetosocket+0x7cc/0xd58 fs/splice.c:889 dosplicefrom fs/splice.c:941 [inline] directspliceactor+0xec/0x1d8 fs/splice.c:1164 splicedirecttoactor+0x438/0xa0c fs/splice.c:1108 dosplicedirectactor ---truncated---

Affected Software

9 affected componentsFixes available
Linux Linux kernel>=4.6<6.1.107
Linux Linux kernel>=6.2<6.6.48
Linux Linux kernel>=6.7<6.10.7
Linux Linux kernel=6.11-rc1
Linux Linux kernel=6.11-rc2
Linux Linux kernel=6.11-rc3
Linux Linux kernel=6.11-rc4
debian/linux<=5.10.223-1
5.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
debian/linux-6.1
6.1.129-1~deb11u1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1
  2. Upgrade

    Upgrade debian/linux-6.1 to a version that resolves this vulnerability.

    Fixed in 6.1.129-1~deb11u1
  3. Compensating control

    Ensure that for the same socket, concurrent threads do not interact with a MSG_MORE skb while it is being built; serialise kcm_sendmsg() per socket (per-sk mutex) to prevent another thread from touching the in-flight MSG_MORE skb.

Event History

Aug 31, 2024
CVE Published
via MITRE·01:22 PM
Data Sourced
via MITRE·01:22 PM
DescriptionSeverity
Data Sourced
via NVD·02:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Apr 27, 2025
Data Sourced
via Ubuntu·12:35 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-44946?

CVE-2024-44946 has a high severity rating due to the potential for a use-after-free vulnerability in the Linux kernel.

2

How do I fix CVE-2024-44946?

To mitigate CVE-2024-44946, you should upgrade your Linux kernel to the fixed versions available in the official repositories.

3

Which Linux kernel versions are vulnerable to CVE-2024-44946?

CVE-2024-44946 affects Linux kernel versions up to and including 6.1.107, as well as any versions before the specified remedied versions.

4

Is CVE-2024-44946 related to any specific Linux distributions?

Yes, CVE-2024-44946 has been identified in Debian's Linux kernel packages and requires specific updated packages to mitigate.

5

What is the impact of CVE-2024-44946 on system security?

The impact of CVE-2024-44946 can lead to potential unauthorized access or control over the affected system due to the use-after-free flaw.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203