ftrace: Add global mutex to serialize trace_parser access
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 689fd8b65d669b96d612ccc37d6fb87bf7ed6907 · < 65bf73bee1a4f3722208ae46afc0fa5de76b9a0a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ftrace: Add global mutex to serialize trace_parser access
In ftrace, the trace_parser structure is allocated and initialized when a trace file is opened, and is subsequently used across write and release handlers to parse user input.
The affected handler paths and their specific functions are: - Open paths: ftrace_regex_open(), ftrace_graph_open() - Write paths: ftrace_regex_write(), ftrace_graph_write() - Release paths: ftrace_regex_release(), ftrace_graph_release()
If userspace opens a trace file descriptor and shares it across multiple threads, concurrent write calls will race on the parser's internal state, specifically the 'idx', 'cont', and 'buffer' fields, leading to corrupted input or undefined behavior.
Fix this by adding a global mutex, parser_lock, to serialize all access to trace_parser across write and release paths, preventing concurrent corruption of parser state.
From the CVE record · Linux
The Linux kernel's ftrace trace parser can race when multiple userspace threads write concurrently to a shared trace file descriptor. This local concurrency can corrupt parsed input or cause undefined behavior; no separate user interaction is described.
Engineers running Linux kernels with the affected ftrace trace-file handlers should check their deployments; affected versions were not specified.