CVE-2023-53558 in Linuxinfo

Summary

by MITRE • 10/04/2025

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

rcu-tasks: Avoid pr_info() with spin lock in cblist_init_generic()

pr_info() is called with rtp->cbs_gbl_lock spin lock locked. Because pr_info() calls printk() that might sleep, this will result in BUG like below:

[ 0.206455] cblist_init_generic: Setting adjustable number of callback queues.
[ 0.206463]
[ 0.206464] =============================
[ 0.206464] [ BUG: Invalid wait context ]
[ 0.206465] 5.19.0-00428-g9de1f9c8ca51 #5 Not tainted
[ 0.206466] -----------------------------
[ 0.206466] swapper/0/1 is trying to lock:
[ 0.206467] ffffffffa0167a58 (&port_lock_key){....}-{3:3}, at: serial8250_console_write+0x327/0x4a0
[ 0.206473] other info that might help us debug this:
[ 0.206473] context-{5:5}
[ 0.206474] 3 locks held by swapper/0/1:
[ 0.206474] #0: ffffffff9eb597e0 (rcu_tasks.cbs_gbl_lock){....}-{2:2}, at: cblist_init_generic.constprop.0+0x14/0x1f0
[ 0.206478] #1: ffffffff9eb579c0 (console_lock){+.+.}-{0:0}, at: _printk+0x63/0x7e
[ 0.206482] #2: ffffffff9ea77780 (console_owner){....}-{0:0}, at: console_emit_next_record.constprop.0+0x111/0x330
[ 0.206485] stack backtrace:
[ 0.206486] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.19.0-00428-g9de1f9c8ca51 #5
[ 0.206488] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014
[ 0.206489] Call Trace:
[ 0.206490] <TASK>
[ 0.206491] dump_stack_lvl+0x6a/0x9f
[ 0.206493] __lock_acquire.cold+0x2d7/0x2fe
[ 0.206496] ? stack_trace_save+0x46/0x70
[ 0.206497] lock_acquire+0xd1/0x2f0
[ 0.206499] ? serial8250_console_write+0x327/0x4a0
[ 0.206500] ? __lock_acquire+0x5c7/0x2720
[ 0.206502] _raw_spin_lock_irqsave+0x3d/0x90
[ 0.206504] ? serial8250_console_write+0x327/0x4a0
[ 0.206506] serial8250_console_write+0x327/0x4a0
[ 0.206508] console_emit_next_record.constprop.0+0x180/0x330
[ 0.206511] console_unlock+0xf7/0x1f0
[ 0.206512] vprintk_emit+0xf7/0x330
[ 0.206514] _printk+0x63/0x7e
[ 0.206516] cblist_init_generic.constprop.0.cold+0x24/0x32
[ 0.206518] rcu_init_tasks_generic+0x5/0xd9
[ 0.206522] kernel_init_freeable+0x15b/0x2a2
[ 0.206523] ? rest_init+0x160/0x160
[ 0.206526] kernel_init+0x11/0x120
[ 0.206527] ret_from_fork+0x1f/0x30
[ 0.206530] </TASK>
[ 0.207018] cblist_init_generic: Setting shift to 1 and lim to 1.

This patch moves pr_info() so that it is called without rtp->cbs_gbl_lock locked.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 03/02/2026

The vulnerability described in CVE-2023-53558 resides within the Linux kernel's RCU (Read-Copy-Update) tasks subsystem, specifically in the cblist_init_generic() function. This flaw represents a classic deadlock scenario involving spin locks and logging mechanisms that can cause system instability during early boot phases. The issue occurs when the kernel attempts to log informational messages using pr_info() while holding a spin lock that is incompatible with sleep operations, creating a fundamental contradiction in kernel execution context.

The technical root cause stems from the improper use of pr_info() within a critical section protected by rtp->cbs_gbl_lock spin lock. When printk() is invoked through pr_info(), it may attempt to sleep during console output processing, which creates an invalid wait context since spin locks are designed to be held for minimal durations and must not sleep. The kernel's lock validator detects this contradiction and generates a BUG message indicating "Invalid wait context" as demonstrated in the stack trace. This pattern violates fundamental kernel design principles where spin locks must be held for the shortest possible time and never in contexts where sleeping operations could occur.

The operational impact of this vulnerability manifests primarily during kernel initialization, particularly in the early boot sequence when RCU tasks are being initialized. Systems may experience kernel panics or complete system lockups during boot, making affected systems unreliable for production environments. The bug appears to be triggered by the console subsystem's interaction with the RCU tasks initialization code, where the console_lock and console_owner locks are also held, creating a complex deadlock scenario. This vulnerability affects all Linux kernel versions that include the problematic RCU tasks implementation and could potentially be exploited to cause denial of service conditions.

The fix implemented addresses this issue by repositioning the pr_info() call outside the critical section where rtp->cbs_gbl_lock is held. This ensures that logging operations occur in a safe context where sleeping is permitted, while maintaining the integrity of the spin lock protection for the actual data structure initialization. The patch follows established kernel development practices for avoiding lock contention and sleep operations in critical sections. This remediation aligns with CWE-367 principle of preventing the use of synchronous operations in contexts where they may cause deadlock, and it addresses ATT&CK technique T1499.004 related to endpoint denial of service through kernel-level resource exhaustion. The fix demonstrates proper kernel programming practices by ensuring atomic operations remain atomic while allowing logging to occur in appropriate contexts, thereby maintaining system stability and preventing the invalid wait context that leads to kernel panics during boot.

Responsible

Linux

Reservation

10/04/2025

Disclosure

10/04/2025

Moderation

accepted

CPE

ready

EPSS

0.00131

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!