Skip to main content

CVE-2023-52866: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2023-52866cvecve-2023-52866
Published: Tue May 21 2024 (05/21/2024, 15:31:57 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: HID: uclogic: Fix user-memory-access bug in uclogic_params_ugee_v2_init_event_hooks() When CONFIG_HID_UCLOGIC=y and CONFIG_KUNIT_ALL_TESTS=y, launch kernel and then the below user-memory-access bug occurs. In hid_test_uclogic_params_cleanup_event_hooks(),it call uclogic_params_ugee_v2_init_event_hooks() with the first arg=NULL, so when it calls uclogic_params_ugee_v2_has_battery(), the hid_get_drvdata() will access hdev->dev with hdev=NULL, which will cause below user-memory-access. So add a fake_device with quirks member and call hid_set_drvdata() to assign hdev->dev->driver_data which avoids the null-ptr-def bug for drvdata->quirks in uclogic_params_ugee_v2_has_battery(). After applying this patch, the below user-memory-access bug never occurs. general protection fault, probably for non-canonical address 0xdffffc0000000329: 0000 [#1] PREEMPT SMP KASAN KASAN: probably user-memory-access in range [0x0000000000001948-0x000000000000194f] CPU: 5 PID: 2189 Comm: kunit_try_catch Tainted: G B W N 6.6.0-rc2+ #30 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 RIP: 0010:uclogic_params_ugee_v2_init_event_hooks+0x87/0x600 Code: f3 f3 65 48 8b 14 25 28 00 00 00 48 89 54 24 60 31 d2 48 89 fa c7 44 24 30 00 00 00 00 48 c7 44 24 28 02 f8 02 01 48 c1 ea 03 <80> 3c 02 00 0f 85 2c 04 00 00 48 8b 9d 48 19 00 00 48 b8 00 00 00 RSP: 0000:ffff88810679fc88 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000004 RCX: 0000000000000000 RDX: 0000000000000329 RSI: ffff88810679fd88 RDI: 0000000000001948 RBP: 0000000000000000 R08: 0000000000000000 R09: ffffed1020f639f0 R10: ffff888107b1cf87 R11: 0000000000000400 R12: 1ffff11020cf3f92 R13: ffff88810679fd88 R14: ffff888100b97b08 R15: ffff8881030bb080 FS: 0000000000000000(0000) GS:ffff888119e80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000005286001 CR4: 0000000000770ee0 DR0: ffffffff8fdd6cf4 DR1: ffffffff8fdd6cf5 DR2: ffffffff8fdd6cf6 DR3: ffffffff8fdd6cf7 DR6: 00000000fffe0ff0 DR7: 0000000000000600 PKRU: 55555554 Call Trace: <TASK> ? die_addr+0x3d/0xa0 ? exc_general_protection+0x144/0x220 ? asm_exc_general_protection+0x22/0x30 ? uclogic_params_ugee_v2_init_event_hooks+0x87/0x600 ? sched_clock_cpu+0x69/0x550 ? uclogic_parse_ugee_v2_desc_gen_params+0x70/0x70 ? load_balance+0x2950/0x2950 ? rcu_trc_cmpxchg_need_qs+0x67/0xa0 hid_test_uclogic_params_cleanup_event_hooks+0x9e/0x1a0 ? uclogic_params_ugee_v2_init_event_hooks+0x600/0x600 ? __switch_to+0x5cf/0xe60 ? migrate_enable+0x260/0x260 ? __kthread_parkme+0x83/0x150 ? kunit_try_run_case_cleanup+0xe0/0xe0 kunit_generic_run_threadfn_adapter+0x4a/0x90 ? kunit_try_catch_throw+0x80/0x80 kthread+0x2b5/0x380 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x2d/0x70 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork_asm+0x11/0x20 </TASK> Modules linked in: Dumping ftrace buffer: (ftrace buffer empty) ---[ end trace 0000000000000000 ]--- RIP: 0010:uclogic_params_ugee_v2_init_event_hooks+0x87/0x600 Code: f3 f3 65 48 8b 14 25 28 00 00 00 48 89 54 24 60 31 d2 48 89 fa c7 44 24 30 00 00 00 00 48 c7 44 24 28 02 f8 02 01 48 c1 ea 03 <80> 3c 02 00 0f 85 2c 04 00 00 48 8b 9d 48 19 00 00 48 b8 00 00 00 RSP: 0000:ffff88810679fc88 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000004 RCX: 0000000000000000 RDX: 0000000000000329 RSI: ffff88810679fd88 RDI: 0000000000001948 RBP: 0000000000000000 R08: 0000000000000000 R09: ffffed1020f639f0 R10: ffff888107b1cf87 R11: 0000000000000400 R12: 1ffff11020cf3f92 R13: ffff88810679fd88 R14: ffff888100b97b08 R15: ffff8881030bb080 FS: 0000000000000000(0000) GS:ffff888119e80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000005286001 CR4: 0000000000770ee0 DR0: ffffffff8fdd6cf4 DR1: ---truncated---

AI-Powered Analysis

AILast updated: 07/01/2025, 07:57:54 UTC

Technical Analysis

CVE-2023-52866 is a vulnerability identified in the Linux kernel specifically affecting the HID (Human Interface Device) subsystem related to the uclogic driver, which handles certain tablet devices. The issue arises when the kernel is configured with CONFIG_HID_UCLOGIC=y and CONFIG_KUNIT_ALL_TESTS=y, leading to a user-memory-access bug during the initialization of event hooks in the function uclogic_params_ugee_v2_init_event_hooks(). The root cause is a null pointer dereference: the function hid_test_uclogic_params_cleanup_event_hooks() calls uclogic_params_ugee_v2_init_event_hooks() with a NULL first argument, which eventually leads to a call to hid_get_drvdata() with a NULL device pointer (hdev=NULL). This results in an invalid memory access when the code attempts to access hdev->dev->driver_data, causing a general protection fault and kernel crash. The vulnerability is triggered during kernel unit testing (KUnit) of the uclogic driver, which is used for certain graphics tablets. The patch involves creating a fake device structure with a quirks member and assigning it via hid_set_drvdata() to prevent the null pointer dereference. The vulnerability does not appear to be exploitable in typical production environments since it is triggered under specific kernel test configurations. There are no known exploits in the wild, and no CVSS score has been assigned yet. The issue primarily affects Linux kernel versions that include the vulnerable uclogic driver code and are built with the specified kernel configurations.

Potential Impact

For European organizations, the impact of CVE-2023-52866 is likely limited due to the specific conditions required to trigger the vulnerability: the kernel must be compiled with both CONFIG_HID_UCLOGIC and CONFIG_KUNIT_ALL_TESTS enabled, the latter being a kernel testing framework not typically enabled in production systems. However, organizations that develop or test Linux kernels, or that use specialized Linux distributions with these configurations enabled, could experience kernel crashes or denial of service during testing phases. The vulnerability could disrupt development and testing workflows, potentially delaying security updates or product releases. Since the vulnerability causes a kernel panic via a null pointer dereference, it affects availability but does not appear to allow privilege escalation or arbitrary code execution. Therefore, the confidentiality and integrity of systems are not directly at risk. Nonetheless, any kernel crash in critical systems could lead to service outages. The vulnerability is unlikely to be exploited in the wild due to its narrow triggering conditions and lack of known exploits. Still, organizations relying on Linux-based embedded devices or specialized hardware using the uclogic driver should verify their kernel configurations to avoid inadvertent exposure.

Mitigation Recommendations

To mitigate CVE-2023-52866, European organizations should: 1) Ensure that production Linux kernels are not compiled with CONFIG_KUNIT_ALL_TESTS enabled, as this is intended for kernel unit testing and not for production use. 2) Apply the patch that introduces a fake_device with a quirks member and assigns it properly to avoid null pointer dereferences in the uclogic driver. 3) Review kernel build configurations to disable unnecessary testing features in production environments. 4) For organizations involved in kernel development or testing, incorporate the patch into their kernel source trees and validate that the uclogic driver no longer triggers the bug during KUnit tests. 5) Monitor Linux kernel mailing lists and vendor advisories for updated kernel releases that include this fix. 6) Conduct thorough testing of kernel updates in staging environments before deployment to production to detect any regressions or related issues. 7) Limit access to kernel testing environments to trusted personnel to reduce risk of accidental triggering. These steps go beyond generic advice by focusing on build configuration management, patch application, and controlled testing environments.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-21T15:19:24.262Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9831c4522896dcbe7797

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

Last enriched: 7/1/2025, 7:57:54 AM

Last updated: 8/12/2025, 10:57:31 AM

Views: 10

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