Skip to main content

CVE-2021-47606: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-47606cvecve-2021-47606
Published: Wed Jun 19 2024 (06/19/2024, 14:54:05 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net: netlink: af_netlink: Prevent empty skb by adding a check on len. Adding a check on len parameter to avoid empty skb. This prevents a division error in netem_enqueue function which is caused when skb->len=0 and skb->data_len=0 in the randomized corruption step as shown below. skb->data[prandom_u32() % skb_headlen(skb)] ^= 1<<(prandom_u32() % 8); Crash Report: [ 343.170349] netdevsim netdevsim0 netdevsim3: set [1, 0] type 2 family 0 port 6081 - 0 [ 343.216110] netem: version 1.3 [ 343.235841] divide error: 0000 [#1] PREEMPT SMP KASAN NOPTI [ 343.236680] CPU: 3 PID: 4288 Comm: reproducer Not tainted 5.16.0-rc1+ [ 343.237569] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014 [ 343.238707] RIP: 0010:netem_enqueue+0x1590/0x33c0 [sch_netem] [ 343.239499] Code: 89 85 58 ff ff ff e8 5f 5d e9 d3 48 8b b5 48 ff ff ff 8b 8d 50 ff ff ff 8b 85 58 ff ff ff 48 8b bd 70 ff ff ff 31 d2 2b 4f 74 <f7> f1 48 b8 00 00 00 00 00 fc ff df 49 01 d5 4c 89 e9 48 c1 e9 03 [ 343.241883] RSP: 0018:ffff88800bcd7368 EFLAGS: 00010246 [ 343.242589] RAX: 00000000ba7c0a9c RBX: 0000000000000001 RCX: 0000000000000000 [ 343.243542] RDX: 0000000000000000 RSI: ffff88800f8edb10 RDI: ffff88800f8eda40 [ 343.244474] RBP: ffff88800bcd7458 R08: 0000000000000000 R09: ffffffff94fb8445 [ 343.245403] R10: ffffffff94fb8336 R11: ffffffff94fb8445 R12: 0000000000000000 [ 343.246355] R13: ffff88800a5a7000 R14: ffff88800a5b5800 R15: 0000000000000020 [ 343.247291] FS: 00007fdde2bd7700(0000) GS:ffff888109780000(0000) knlGS:0000000000000000 [ 343.248350] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 343.249120] CR2: 00000000200000c0 CR3: 000000000ef4c000 CR4: 00000000000006e0 [ 343.250076] Call Trace: [ 343.250423] <TASK> [ 343.250713] ? memcpy+0x4d/0x60 [ 343.251162] ? netem_init+0xa0/0xa0 [sch_netem] [ 343.251795] ? __sanitizer_cov_trace_pc+0x21/0x60 [ 343.252443] netem_enqueue+0xe28/0x33c0 [sch_netem] [ 343.253102] ? stack_trace_save+0x87/0xb0 [ 343.253655] ? filter_irq_stacks+0xb0/0xb0 [ 343.254220] ? netem_init+0xa0/0xa0 [sch_netem] [ 343.254837] ? __kasan_check_write+0x14/0x20 [ 343.255418] ? _raw_spin_lock+0x88/0xd6 [ 343.255953] dev_qdisc_enqueue+0x50/0x180 [ 343.256508] __dev_queue_xmit+0x1a7e/0x3090 [ 343.257083] ? netdev_core_pick_tx+0x300/0x300 [ 343.257690] ? check_kcov_mode+0x10/0x40 [ 343.258219] ? _raw_spin_unlock_irqrestore+0x29/0x40 [ 343.258899] ? __kasan_init_slab_obj+0x24/0x30 [ 343.259529] ? setup_object.isra.71+0x23/0x90 [ 343.260121] ? new_slab+0x26e/0x4b0 [ 343.260609] ? kasan_poison+0x3a/0x50 [ 343.261118] ? kasan_unpoison+0x28/0x50 [ 343.261637] ? __kasan_slab_alloc+0x71/0x90 [ 343.262214] ? memcpy+0x4d/0x60 [ 343.262674] ? write_comp_data+0x2f/0x90 [ 343.263209] ? __kasan_check_write+0x14/0x20 [ 343.263802] ? __skb_clone+0x5d6/0x840 [ 343.264329] ? __sanitizer_cov_trace_pc+0x21/0x60 [ 343.264958] dev_queue_xmit+0x1c/0x20 [ 343.265470] netlink_deliver_tap+0x652/0x9c0 [ 343.266067] netlink_unicast+0x5a0/0x7f0 [ 343.266608] ? netlink_attachskb+0x860/0x860 [ 343.267183] ? __sanitizer_cov_trace_pc+0x21/0x60 [ 343.267820] ? write_comp_data+0x2f/0x90 [ 343.268367] netlink_sendmsg+0x922/0xe80 [ 343.268899] ? netlink_unicast+0x7f0/0x7f0 [ 343.269472] ? __sanitizer_cov_trace_pc+0x21/0x60 [ 343.270099] ? write_comp_data+0x2f/0x90 [ 343.270644] ? netlink_unicast+0x7f0/0x7f0 [ 343.271210] sock_sendmsg+0x155/0x190 [ 343.271721] ____sys_sendmsg+0x75f/0x8f0 [ 343.272262] ? kernel_sendmsg+0x60/0x60 [ 343.272788] ? write_comp_data+0x2f/0x90 [ 343.273332] ? write_comp_data+0x2f/0x90 [ 343.273869] ___sys_sendmsg+0x10f/0x190 [ 343.274405] ? sendmsg_copy_msghdr+0x80/0x80 [ 343.274984] ? slab_post_alloc_hook+0x70/0x230 [ 343.275597] ? futex_wait_setup+0x240/0x240 [ 343.276175] ? security_file_alloc+0x3e/0x170 [ 343.276779] ? write_comp_d ---truncated---

AI-Powered Analysis

AILast updated: 06/30/2025, 15:25:28 UTC

Technical Analysis

CVE-2021-47606 is a vulnerability in the Linux kernel's networking subsystem, specifically within the netlink interface and the netem (network emulator) queuing discipline. The issue arises due to the lack of a proper check on the length parameter (len) when handling socket buffers (skb). In particular, when skb->len and skb->data_len are both zero, the netem_enqueue function attempts a randomized corruption step on the skb data using an expression that involves modulo operations on skb_headlen(skb). Since skb_headlen(skb) can be zero in this scenario, this leads to a division by zero error, causing a kernel crash (divide error). This vulnerability can be triggered remotely by sending crafted netlink messages that result in empty skb buffers being processed by netem. The crash logs indicate a kernel panic with a divide error in netem_enqueue, which can cause denial of service (DoS) by crashing the affected system. The vulnerability was addressed by adding a check on the len parameter to prevent empty skb buffers from being processed, thus avoiding the division error. The affected Linux kernel versions include those prior to the patch commit identified by the hash 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2. There are no known exploits in the wild at this time, and no CVSS score has been assigned. The vulnerability is technical and low-level, affecting the kernel's network packet processing path, which is critical for network communication and stability.

Potential Impact

For European organizations, this vulnerability poses a risk primarily in environments running vulnerable Linux kernel versions with netem enabled, which is common in network simulation, testing, and traffic shaping scenarios. Exploitation can lead to kernel crashes and system downtime, resulting in denial of service. This can disrupt critical network services, impacting availability of applications and services dependent on Linux-based infrastructure. Organizations relying on Linux servers for networking, cloud infrastructure, or embedded systems could experience outages or degraded performance. While the vulnerability does not appear to allow privilege escalation or remote code execution, the induced kernel panic can be leveraged by attackers to disrupt operations or as part of a larger attack chain. The impact is more pronounced in environments with high network traffic or where netem is actively used for traffic control. Given the widespread use of Linux in European data centers, telecom infrastructure, and industrial control systems, the potential for service disruption is significant if unpatched systems are targeted.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernel to versions that include the patch for CVE-2021-47606. Specifically, they should identify systems running kernel versions prior to the commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and apply vendor-supplied kernel updates or backported patches. Network administrators should audit the use of netem and netlink configurations to ensure no untrusted or unnecessary netlink message sources exist, reducing the attack surface. Implementing strict access controls on netlink sockets and limiting capabilities of unprivileged users can prevent exploitation attempts. Monitoring kernel logs for divide errors or netem-related crashes can help detect attempted exploitation. In environments where immediate patching is not feasible, disabling netem or restricting its usage temporarily can mitigate risk. Additionally, employing kernel hardening features such as KASAN (Kernel Address Sanitizer) and enabling kernel crash dump analysis can aid in early detection and response. Regular vulnerability scanning and patch management processes should incorporate this vulnerability to maintain security posture.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-24T15:11:00.737Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9834c4522896dcbe959b

Added to database: 5/21/2025, 9:09:08 AM

Last enriched: 6/30/2025, 3:25:28 PM

Last updated: 8/4/2025, 6:30:00 PM

Views: 12

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats