gpu: host1x: Avoid stack over-read in debug output helpers
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 6236451d83a720072053855fa63d51934024a707 · < 9ad7a6ccc7b839247663d57d3dbb4481dec492de| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
gpu: host1x: Avoid stack over-read in debug output helpers
host1x_debug_output() and host1x_debug_cont() used vsnprintf(), which returns the length the formatted string would have reached with an unbounded buffer. That return value was passed straight to o->fn as the number of bytes to emit.
This could cause a read past end of the output buffer if a call to host1x_debug_* produced a string longer than 256 bytes. This only affected the debugfs files as the printk debug sink ignores the number of bytes. In practice, this is very unlikely to occur.
Fix by switching to vscnprintf(), which returns the number of bytes actually written.
From the CVE record · Linux
The Linux kernel’s host1x debug output helpers can read past a 256-byte buffer when formatted output exceeds 256 bytes. This affects debugfs output and could expose data to someone able to read the affected debugfs files; the input does not specify authentication requirements. The condition is described as very unlikely in practice.
Engineers running Linux kernels with host1x debugfs support should check their versions against the vendor advisory; affected versions are not specified.