CVE-2022-48953

Source
https://cve.org/CVERecord?id=CVE-2022-48953
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-48953.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-48953
Downstream
Related
Published
2024-10-21T20:05:40.399Z
Modified
2026-03-12T03:24:19.346369Z
Summary
rtc: cmos: Fix event handler registration ordering issue
Details

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 rtc_handler() 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.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/48xxx/CVE-2022-48953.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
a474aaedac99ba86e28ef6c912a7647c482db6dd
Fixed
0bcfccb48696aba475f046c2021f0733659ce0ef
Fixed
60c6e563a843032cf6ff84b2fb732cd8754fc10d
Fixed
1ba745fce13d19775100eece30b0bfb8b8b10ea6
Fixed
4919d3eb2ec0ee364f7e3cf2d99646c1b224fae8

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-48953.json"