CVE-2021-47598: sch_cake: do not call cake_destroy() from cake_init()

Published Jun 19, 2024
·
Updated

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

schcake: do not call cakedestroy() from cakeinit()

qdiscs are not supposed to call their own destroy() method from init(), because core stack already does that.

syzbot was able to trigger use after free:

DEBUGLOCKSWARNON(lock->magic != lock) WARNING: CPU: 0 PID: 21902 at kernel/locking/mutex.c:586 mutexlockcommon kernel/locking/mutex.c:586 [inline] WARNING: CPU: 0 PID: 21902 at kernel/locking/mutex.c:586 mutexlock+0x9ec/0x12f0 kernel/locking/mutex.c:740 Modules linked in: CPU: 0 PID: 21902 Comm: syz-executor189 Not tainted 5.16.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:mutexlockcommon kernel/locking/mutex.c:586 [inline] RIP: 0010:mutexlock+0x9ec/0x12f0 kernel/locking/mutex.c:740 Code: 08 84 d2 0f 85 19 08 00 00 8b 05 97 38 4b 04 85 c0 0f 85 27 f7 ff ff 48 c7 c6 20 00 ac 89 48 c7 c7 a0 fe ab 89 e8 bf 76 ba ff <0f> 0b e9 0d f7 ff ff 48 8b 44 24 40 48 8d b8 c8 08 00 00 48 89 f8 RSP: 0018:ffffc9000627f290 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff88802315d700 RSI: ffffffff815f1db8 RDI: fffff52000c4fe44 RBP: ffff88818f28e000 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff815ebb5e R11: 0000000000000000 R12: 0000000000000000 R13: dffffc0000000000 R14: ffffc9000627f458 R15: 0000000093c30000 FS: 0000555556abc400(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fda689c3303 CR3: 000000001cfbb000 CR4: 0000000000350ef0 Call Trace: <TASK> tcfchain0headchangecbdel+0x2e/0x3d0 net/sched/clsapi.c:810 tcfblockputext net/sched/clsapi.c:1381 [inline] tcfblockputext net/sched/clsapi.c:1376 [inline] tcfblockput+0xbc/0x130 net/sched/clsapi.c:1394 cakedestroy+0x3f/0x80 net/sched/schcake.c:2695 qdisccreate.constprop.0+0x9da/0x10f0 net/sched/schapi.c:1293 tcmodifyqdisc+0x4c5/0x1980 net/sched/schapi.c:1660 rtnetlinkrcvmsg+0x413/0xb80 net/core/rtnetlink.c:5571 netlinkrcvskb+0x153/0x420 net/netlink/afnetlink.c:2496 netlinkunicastkernel net/netlink/afnetlink.c:1319 [inline] netlinkunicast+0x533/0x7d0 net/netlink/afnetlink.c:1345 netlinksendmsg+0x904/0xdf0 net/netlink/afnetlink.c:1921 socksendmsgnosec net/socket.c:704 [inline] socksendmsg+0xcf/0x120 net/socket.c:724 syssendmsg+0x6e8/0x810 net/socket.c:2409 syssendmsg+0xf3/0x170 net/socket.c:2463 syssendmsg+0xe5/0x1b0 net/socket.c:2492 dosyscallx64 arch/x86/entry/common.c:50 [inline] dosyscall64+0x35/0xb0 arch/x86/entry/common.c:80 entrySYSCALL64afterhwframe+0x44/0xae RIP: 0033:0x7f1bb06badb9 Code: Unable to access opcode bytes at RIP 0x7f1bb06bad8f. RSP: 002b:00007fff3012a658 EFLAGS: 00000246 ORIGRAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f1bb06badb9 RDX: 0000000000000000 RSI: 00000000200007c0 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000003 R09: 0000000000000003 R10: 0000000000000003 R11: 0000000000000246 R12: 00007fff3012a688 R13: 00007fff3012a6a0 R14: 00007fff3012a6e0 R15: 00000000000013c2 </TASK>

Affected Software

95 affected componentsFixes available
Linux Linux kernel>=4.19<4.19.222
Linux Linux kernel>=4.20<5.4.168
Linux Linux kernel>=5.5<5.10.88
Linux Linux kernel>=5.11<5.15.11
ubuntu/linux-hwe-edge*
ubuntu/linux-aws-5.4<5.4.0-1069.73~18.04.1
5.4.0-1069.73~18.04.1
ubuntu/linux-azure-5.4<5.4.0-1073.76~18.04.1
5.4.0-1073.76~18.04.1
ubuntu/linux-gcp-5.4<5.4.0-1068.72~18.04.1
5.4.0-1068.72~18.04.1
ubuntu/linux-hwe-5.4<5.4.0-105.119~18.04.1
5.4.0-105.119~18.04.1
ubuntu/linux-ibm-5.4<5.4.0-1018.20~18.04.1
5.4.0-1018.20~18.04.1
ubuntu/linux-oracle-5.4<5.4.0-1067.72~18.04.1
5.4.0-1067.72~18.04.1
ubuntu/linux-raspi-5.4<5.4.0-1056.63~18.04.1
5.4.0-1056.63~18.04.1
ubuntu/linux-aws-5.0*
ubuntu/linux-aws-5.3*
ubuntu/linux-azure*
ubuntu/linux-azure-5.3*
ubuntu/linux-azure-edge*
ubuntu/linux-gcp*
ubuntu/linux-gcp-5.3*
ubuntu/linux-gke-4.15*
ubuntu/linux-gke-5.4*
ubuntu/linux-gkeop-5.4*
ubuntu/linux-hwe*
ubuntu/linux-hwe-edge*
ubuntu/linux-oem*
ubuntu/linux-oracle-5.0*
ubuntu/linux-oracle-5.3*
ubuntu/linux<5.4.0-105.119
5.4.0-105.119
ubuntu/linux-aws<5.4.0-1069.73
5.4.0-1069.73
ubuntu/linux-azure<5.4.0-1073.76
5.4.0-1073.76
ubuntu/linux-bluefield<5.4.0-1032.35
5.4.0-1032.35
ubuntu/linux-gcp<5.4.0-1068.72
5.4.0-1068.72
ubuntu/linux-gkeop<5.4.0-1037.38
5.4.0-1037.38
ubuntu/linux-ibm<5.4.0-1018.20
5.4.0-1018.20
ubuntu/linux-kvm<5.4.0-1059.62
5.4.0-1059.62
ubuntu/linux-oracle<5.4.0-1067.72
5.4.0-1067.72
ubuntu/linux-raspi<5.4.0-1056.63
5.4.0-1056.63
ubuntu/linux-aws-5.11*
ubuntu/linux-aws-5.13*
ubuntu/linux-aws-5.8*
ubuntu/linux-azure-5.11*
ubuntu/linux-azure-5.13*
ubuntu/linux-azure-5.8*
ubuntu/linux-azure-fde*
ubuntu/linux-gcp-5.11*
ubuntu/linux-gcp-5.13*
ubuntu/linux-gcp-5.8*
ubuntu/linux-gke*
ubuntu/linux-gke-5.15*
ubuntu/linux-hwe-5.11*
ubuntu/linux-hwe-5.13*
ubuntu/linux-hwe-5.8*
ubuntu/linux-intel-5.13*
ubuntu/linux-oem-5.10*
ubuntu/linux-oem-5.13*
ubuntu/linux-oem-5.6*
ubuntu/linux-oracle-5.11*
ubuntu/linux-oracle-5.13*
ubuntu/linux-oracle-5.8*
ubuntu/linux-raspi2*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.11*
ubuntu/linux-riscv-5.8*
ubuntu/linux-aws-fips<5.4.0-1069.73+fips2
5.4.0-1069.73+fips2
ubuntu/linux-azure-fips<5.4.0-1073.76+fips1
5.4.0-1073.76+fips1
ubuntu/linux-fips<5.4.0-1046.52
5.4.0-1046.52
ubuntu/linux-gcp-fips<5.4.0-1067.71~20.04.1
5.4.0-1067.71~20.04.1
ubuntu/linux-aws-fips*
ubuntu/linux-azure-fips*
ubuntu/linux-fips*
ubuntu/linux-gcp-fips*
ubuntu/linux-allwinner-5.19*
ubuntu/linux-aws-5.19*
ubuntu/linux-aws-6.2*
ubuntu/linux-azure-5.19*
ubuntu/linux-azure-6.2*
ubuntu/linux-azure-fde-5.19*
ubuntu/linux-azure-fde-6.2*
ubuntu/linux-gcp-5.19*
ubuntu/linux-gcp-6.2*
ubuntu/linux-hwe-5.19*
ubuntu/linux-hwe-6.2*
ubuntu/linux-intel-iot-realtime*
ubuntu/linux-lowlatency-hwe-5.19*
ubuntu/linux-lowlatency-hwe-6.2*
ubuntu/linux-nvidia-6.2*
ubuntu/linux-oem-5.17*
ubuntu/linux-oem-6.0*
ubuntu/linux-oem-6.1*
ubuntu/linux-realtime*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.19*
ubuntu/linux-starfive-5.19*
ubuntu/linux-starfive-6.2*
ubuntu/linux-raspi-realtime*

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade ubuntu/linux-aws-5.4 to a version that resolves this vulnerability.

    Fixed in 5.4.0-1069.73~18.04.1
  2. Upgrade

    Upgrade ubuntu/linux-azure-5.4 to a version that resolves this vulnerability.

    Fixed in 5.4.0-1073.76~18.04.1
  3. Upgrade

    Upgrade ubuntu/linux-gcp-5.4 to a version that resolves this vulnerability.

    Fixed in 5.4.0-1068.72~18.04.1
  4. Upgrade

    Upgrade ubuntu/linux-hwe-5.4 to a version that resolves this vulnerability.

    Fixed in 5.4.0-105.119~18.04.1
  5. Upgrade

    Upgrade ubuntu/linux-ibm-5.4 to a version that resolves this vulnerability.

    Fixed in 5.4.0-1018.20~18.04.1
  6. Upgrade

    Upgrade ubuntu/linux-oracle-5.4 to a version that resolves this vulnerability.

    Fixed in 5.4.0-1067.72~18.04.1
  7. Upgrade

    Upgrade ubuntu/linux-raspi-5.4 to a version that resolves this vulnerability.

    Fixed in 5.4.0-1056.63~18.04.1
  8. Upgrade

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

    Fixed in 5.4.0-105.119
  9. Upgrade

    Upgrade ubuntu/linux-aws to a version that resolves this vulnerability.

    Fixed in 5.4.0-1069.73
  10. Upgrade

    Upgrade ubuntu/linux-azure to a version that resolves this vulnerability.

    Fixed in 5.4.0-1073.76
  11. Upgrade

    Upgrade ubuntu/linux-bluefield to a version that resolves this vulnerability.

    Fixed in 5.4.0-1032.35
  12. Upgrade

    Upgrade ubuntu/linux-gcp to a version that resolves this vulnerability.

    Fixed in 5.4.0-1068.72
  13. Upgrade

    Upgrade ubuntu/linux-gkeop to a version that resolves this vulnerability.

    Fixed in 5.4.0-1037.38
  14. Upgrade

    Upgrade ubuntu/linux-ibm to a version that resolves this vulnerability.

    Fixed in 5.4.0-1018.20
  15. Upgrade

    Upgrade ubuntu/linux-kvm to a version that resolves this vulnerability.

    Fixed in 5.4.0-1059.62
  16. Upgrade

    Upgrade ubuntu/linux-oracle to a version that resolves this vulnerability.

    Fixed in 5.4.0-1067.72
  17. Upgrade

    Upgrade ubuntu/linux-raspi to a version that resolves this vulnerability.

    Fixed in 5.4.0-1056.63
  18. Upgrade

    Upgrade ubuntu/linux-aws-fips to a version that resolves this vulnerability.

    Fixed in 5.4.0-1069.73+fips2
  19. Upgrade

    Upgrade ubuntu/linux-azure-fips to a version that resolves this vulnerability.

    Fixed in 5.4.0-1073.76+fips1
  20. Upgrade

    Upgrade ubuntu/linux-fips to a version that resolves this vulnerability.

    Fixed in 5.4.0-1046.52
  21. Upgrade

    Upgrade ubuntu/linux-gcp-fips to a version that resolves this vulnerability.

    Fixed in 5.4.0-1067.71~20.04.1

Event History

Jun 19, 2024
CVE Published
via MITRE·02:53 PM
Data Sourced
via MITRE·02:53 PM
Description
Data Sourced
via OSV·03:15 PM
DescriptionSeverityAffected Software
Event
via OSV·03:15 PM
Data Sourced
via NVD·03:15 PM
Description
Aug 27, 2024
Data Sourced
via NVD·04:14 PM
RemedySeverityWeaknessAffected Software
Aug 4, 2026
Data Sourced
via MITRE·09:01 AM
Severity
Updated
via NVD·10:17 AM
RemedySeverityAffected Software
Nov 12, 2026
Updated
via OSV·05:23 PM
Affected Software

Frequently Asked Questions

1

What is the severity of CVE-2021-47598?

CVE-2021-47598 has been classified with a high severity due to the potential for use after free vulnerability in the Linux kernel.

2

How do I fix CVE-2021-47598?

To mitigate CVE-2021-47598, update the Linux kernel to the latest version that has patched this vulnerability.

3

What versions of the Linux kernel are affected by CVE-2021-47598?

CVE-2021-47598 affects Linux kernel versions from 4.19 up to 5.15.11 excluding certain patched versions.

4

What is the primary issue caused by CVE-2021-47598?

The primary issue caused by CVE-2021-47598 is a use after free vulnerability due to incorrect handling during the initialization of sch_cake.

5

Can CVE-2021-47598 lead to remote code execution?

Yes, CVE-2021-47598 could potentially be exploited to gain elevated privileges or execute arbitrary code on affected systems.

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