CVE-2022-48953: rtc: cmos: Fix event handler registration ordering issue
In the Linux kernel, the following vulnerability has been resolved:
rtc: cmos: Fix event handler registration ordering issue
Because acpiinstallfixedeventhandler() enables the event automatically on success, it is incorrect to call it before the handler routine passed to it is ready to handle events.
Unfortunately, the rtc-cmos driver does exactly the incorrect thing by calling cmoswakesetup(), which passes rtchandler() to acpiinstallfixedeventhandler(), before cmosdoprobe(), because rtchandler() uses devgetdrvdata() to get to the cmos object pointer and the driver data pointer is only populated in cmosdoprobe().
This leads to a NULL pointer dereference in rtchandler() on boot if the RTC fixed event happens to be active at the init time.
To address this issue, change the initialization ordering of the driver so that cmoswakesetup() is always called after a successful cmosdoprobe() call.
While at it, change cmospnpprobe() to call cmosdoprobe() after the initial if () statement used for computing the IRQ argument to be passed to cmosdoprobe() which is cleaner than calling it in each branch of that if () (local variable "irq" can be of type int, because it is passed to that function as an argument of type int).
Note that commit 6492fed7d8c9 ("rtc: rtc-cmos: Do not check ACPIFADTLOWPOWERS0") caused this issue to affect a larger number of systems, because previously it only affected systems with ACPIFADTLOWPOWERS0 set, but it is present regardless of that commit.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2022-48953?
CVE-2022-48953 is classified as a moderate severity vulnerability affecting the Linux kernel.
How do I fix CVE-2022-48953?
To fix CVE-2022-48953, update the Linux kernel to a version that includes the fix, specifically versions beyond those mentioned in the vulnerability description.
Which Linux kernel versions are affected by CVE-2022-48953?
CVE-2022-48953 affects Linux kernel versions from 2.6.28 to 6.1-rc8, excluding any patched releases.
What type of vulnerability is CVE-2022-48953?
CVE-2022-48953 is a bug in the event handler registration mechanism of the Linux kernel's RTC subsystem.
Is CVE-2022-48953 a remote exploit risk?
CVE-2022-48953 does not appear to present a remote exploit risk, as it primarily involves kernel-level access.