printk: Fix possible console use-after-free
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
printk: Fix possible console use-after-free
When emitting a record via legacy printing, it is possible that a handover to another legacy printing context occurs. When a context has performed a handover, the console SRCU read lock is released and the pointer to the console struct might now be invalid. Therefore, after calling nbcon_legacy_emit_next_record() or console_emit_next_record(), it is necessary to check if a handover occurred _before_ further @con usage.
Sashiko pointed out that console_flush_one_record() was not doing this.
In console_flush_one_record(), after emitting a record, move the further usage of @con after the handover check.
From the CVE record · Linux
The Linux kernel's printk code may use a console pointer after a legacy printing handover releases the lock protecting it. This could cause a use-after-free during console output; the input does not describe an attacker path, authentication requirement, or user interaction.
Engineers running the Linux kernel should check their versions against the vendor advisory; affected versions are not specified.