CVE-2025-68319: netconsole: Acquire su_mutex before navigating configs hierarchy
In the Linux kernel, the following vulnerability has been resolved:
netconsole: Acquire sumutex before navigating configs hierarchy
There is a race between operations that iterate over the userdata cgchildren list and concurrent add/remove of userdata items through configfs. The updateuserdata() function iterates over the nt->userdatagroup.cgchildren list, and countextradataentries() also iterates over this same list to count nodes.
Quoting from Documentation/filesystems/configfs.rst: A subsystem can navigate the cgchildren list and the ciparent pointer to see the tree created by the subsystem. This can race with configfs' management of the hierarchy, so configfs uses the subsystem mutex to protect modifications. Whenever a subsystem wants to navigate the hierarchy, it must do so under the protection of the subsystem mutex.
Without proper locking, if a userdata item is added or removed concurrently while these functions are iterating, the list can be accessed in an inconsistent state. For example, the listforeach() loop can reach a node that is being removed from the list by listdelinit() which sets the nodes' .next pointer to point to itself, so the loop will never end (or reach the WARNONONCE in updateuserdata() ).
Fix this by holding the configfs subsystem mutex (sumutex) during all operations that iterate over cgchildren. This includes: - userdatumvaluestore() which calls updateuserdata() to iterate over cgchildren - All sysdataenabledstore() functions which call countextradataentries() to iterate over cgchildren
The sumutex must be acquired before dynamicnetconsolemutex to avoid potential lock ordering issues, as configfs operations may already hold sumutex when calling into our code.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Acquire and hold the configfs subsystem mutex (su_mutex) while navigating the cg_children list or ci_parent hierarchy and while iterating over userdata items, including count_extradata_entries(); acquire su_mutex before dynamic_netconsole_mutex.
Linux kernel netconsole/configfs su_mutex = held during all navigation and iteration of the configfs hierarchy, before acquiring dynamic_netconsole_mutex
Event History
Frequently Asked Questions
What is the severity of CVE-2025-68319?
CVE-2025-68319 is considered to have a medium severity due to the potential for race conditions affecting userdata configurations.
How do I fix CVE-2025-68319?
To fix CVE-2025-68319, update to the latest version of the Linux kernel where the vulnerability has been patched.
What systems are affected by CVE-2025-68319?
CVE-2025-68319 affects all versions of the Linux kernel that allow manipulation of userdata items through configfs.
What are the potential impacts of CVE-2025-68319?
The potential impacts of CVE-2025-68319 include data inconsistency and instability in applications utilizing the Linux kernel's configfs.
Who discovered CVE-2025-68319?
CVE-2025-68319 was discovered as part of ongoing security assessments within the Linux kernel development community.