CVE-2024-58021 in Linuxinfo

Summary

by MITRE • 02/27/2025

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

HID: winwing: Add NULL check in winwing_init_led()

devm_kasprintf() can return a NULL pointer on failure,but this returned value in winwing_init_led() is not checked. Add NULL check in winwing_init_led(), to handle kernel NULL pointer dereference error.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 05/25/2026

The vulnerability identified as CVE-2024-58021 resides within the Linux kernel's Human Interface Device subsystem, specifically affecting the winwing driver module. This driver handles input devices from Windows-compatible gaming controllers and similar HID peripherals. The flaw manifests in the winwing_init_led() function where proper error handling for memory allocation failures has been omitted, creating a potential pathway for kernel crashes and system instability.

The technical root cause involves the devm_kasprintf() function which is responsible for dynamically allocating memory and formatting strings for device identification purposes. This function can return a NULL pointer when memory allocation fails, but the winwing_init_led() implementation fails to validate this return value before proceeding with subsequent operations. When devm_kasprintf() returns NULL, the subsequent code attempts to use this invalid pointer, leading to a kernel NULL pointer dereference error that can result in immediate system crashes or more subtle memory corruption issues.

The operational impact of this vulnerability extends beyond simple system crashes, as it represents a potential denial of service condition that could affect gaming systems, embedded devices, or any platform relying on Windows-compatible HID devices. Attackers could potentially trigger this condition through malformed device connections or by exhausting system memory resources, causing the kernel to panic and requiring system reboot. This vulnerability affects systems running Linux kernel versions where the winwing driver is present and actively used for HID device management.

The flaw aligns with CWE-476 which specifically addresses NULL pointer dereference conditions in software development practices. From an adversarial perspective, this vulnerability maps to ATT&CK technique T1059.001 for command and control through kernel-level exploitation, though the primary risk remains system stability rather than direct privilege escalation. The vulnerability demonstrates poor defensive programming practices where error conditions are not properly handled, representing a fundamental security gap in kernel memory management.

Mitigation strategies should prioritize immediate kernel updates from trusted sources, as the fix involves adding a simple NULL pointer check in the winwing_init_led() function. System administrators should also implement monitoring for kernel panic events and device connection anomalies that might indicate exploitation attempts. Additional defensive measures include restricting device access through udev rules, implementing proper memory pressure handling, and ensuring adequate system resources are available to prevent allocation failures. Organizations should also consider implementing kernel hardening measures such as stack canaries and address space layout randomization to reduce exploitability of similar memory corruption vulnerabilities.

Responsible

Linux

Reservation

02/27/2025

Disclosure

02/27/2025

Moderation

accepted

CPE

ready

EPSS

0.00206

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!