CVE-2024-50058 serial: protect uart_port_dtr_rts() in uart_shutdown() too
A null pointer dereference in the Linux kernel serial driver can cause a system crash when HUPCL is set during shutdown.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-50058?
CVE-2024-50058 is a medium-severity vulnerability in Linux kernel, published on 21 Oct 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
serial: protect uart_port_dtr_rts() in uart_shutdown() too
Commit af224ca2df29 (serial: core: Prevent unsafe uart port access, part 3) added few uport == NULL checks. It added one to uart_shutdown(), so the commit assumes, uport can be NULL in there. But right after that protection, there is an unprotected "uart_port_dtr_rts(uport, false);" call. That is invoked only if HUPCL is set, so I assume that is the reason why we do not see lots of these reports.
Or it cannot be NULL at this point at all for some reason :P.
Until the above is investigated, stay on the safe side and move this dereference to the if too.
I got this inconsistency from Coverity under CID 1585130. Thanks.
Weakness: CWE-476
Which versions are affected by CVE-2024-50058?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-50058?
Apply the vendor's patch.
Is CVE-2024-50058 being exploited?
There is no known exploitation of CVE-2024-50058 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-51073, AZL-51101, BELL-CVE-2024-50058, DEBIAN-CVE-2024-50058, GHSA-v8h5-cghp-q3c4, UBUNTU-CVE-2024-50058.