watchdog: Fix possible use-after-free by calling del_timer_sync()
Published May 21, 2024
7.8
HIGHCVSS 3.1
EPSS 0.25%
Description
This driver's remove path calls del_timer(). However, that function does not wait until the timer handler finishes. This means that the timer handler may still be running after the driver's remove function has finished, which would result in a use-after-free.
Fix by calling del_timer_sync(), which makes sure the timer handler has finished, and unable to re-schedule itself.
Affected products
-
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version
-
- Version 4.3StatusaffectedConstraints-
- Version 0StatusunaffectedConstraints<4.3
- Version 4.14.240StatusunaffectedConstraints<=4.14.*
- Version 4.19.198StatusunaffectedConstraints<=4.19.*
- Version 4.4.276StatusunaffectedConstraints<=4.4.*
- Version 4.9.276StatusunaffectedConstraints<=4.9.*
- Version 5.10.52StatusunaffectedConstraints<=5.10.*
- Version 5.12.19StatusunaffectedConstraints<=5.12.*
- Version 5.13.4StatusunaffectedConstraints<=5.13.*
- Version 5.14StatusunaffectedConstraints<=*
- Version 5.4.134StatusunaffectedConstraints<=5.4.*
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Linux | Linux | unaffected |
| ||||||||||||||||||||||||||||||||||||
| Linux | Linux | affected |
|
- < 4.4.276
- ≥ 4.5 · < 4.9.276
- ≥ 4.10 · < 4.14.240
- ≥ 4.15 · < 4.19.198
- ≥ 4.20 · < 5.4.134
- ≥ 5.5 · < 5.10.52
- ≥ 5.11 · < 5.12.9
- ≥ 5.13 · < 5.13.4
No data.
Red Hat Enterprise Linux 8
kernel-0:4.18.0-553.22.1.el8_10
Fixed · RHSA-2024:7000
Red Hat Enterprise Linux 8
kernel-rt-0:4.18.0-553.22.1.rt7.363.el8_10
Fixed · RHSA-2024:7001
Red Hat Enterprise Linux 8.8 Extended Update Support
kernel-0:4.18.0-477.75.1.el8_8
Fixed · RHSA-2024:8107
Red Hat Enterprise Linux 6
kernel
Out of support scope
Red Hat Enterprise Linux 7
kernel
Out of support scope
Red Hat Enterprise Linux 7
kernel-rt
Out of support scope
Red Hat Enterprise Linux 9
kernel
Not affected
Red Hat Enterprise Linux 9
kernel-rt
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 8 | kernel-0:4.18.0-553.22.1.el8_10 | Fixed | RHSA-2024:7000 |
| Red Hat Enterprise Linux 8 | kernel-rt-0:4.18.0-553.22.1.rt7.363.el8_10 | Fixed | RHSA-2024:7001 |
| Red Hat Enterprise Linux 8.8 Extended Update Support | kernel-0:4.18.0-477.75.1.el8_8 | Fixed | RHSA-2024:8107 |
| Red Hat Enterprise Linux 6 | kernel | Out of support scope | n/a |
| Red Hat Enterprise Linux 7 | kernel | Out of support scope | n/a |
| Red Hat Enterprise Linux 7 | kernel-rt | Out of support scope | n/a |
| Red Hat Enterprise Linux 9 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 9 | kernel-rt | Not affected | n/a |
No package ranges for this CVE.
Remediation
Red Hat statement
This vulnerability is rated as a moderate severity because this issue does not allow unauthorized access or data leakage, but it poses a risk of system instability and crashes. The potential for a use-after-free condition can disrupt normal operations.
Red Hat mitigation
Red Hat has investigated whether a possible mitigation exists for this issue, and has not been able to identify a practical example. Please update the affected package as soon as possible.
References (14)
- https://access.redhat.com/security/cve/CVE-2021-47321 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2282440 Issue Tracking
- https://git.kernel.org/stable/c/1a053c4d716898a53c2e31c574a70ea0c37044a3 Patch
- https://git.kernel.org/stable/c/4c05dac488a660fe2925c047ecb119e7afaaeb1e Patch
- https://git.kernel.org/stable/c/58606882ad8ec6c39e0f40344b922921ef94ab4d Patch
- https://git.kernel.org/stable/c/66ba9cf929b1c4fabf545bd4c18f6f64e23e46e4 Patch
- https://git.kernel.org/stable/c/8bec568d7518b1504a602ed5376bb322e4dbb270 Patch
- https://git.kernel.org/stable/c/ca96b8ea5e74956071154bdb456778cc3027e79f Patch
- https://git.kernel.org/stable/c/d0212f095ab56672f6f36aabc605bda205e1e0bf Patch
- https://git.kernel.org/stable/c/db222f1477ad5692cd454709b714949807e5d111 Patch
- https://git.kernel.org/stable/c/ecd620e0fb1ff7f78fdb593379b2e6938c99707a Patch
- https://lore.kernel.org/linux-cve-announce/2024052132-CVE-2021-47321-1b9b@gregkh/T
- https://nvd.nist.gov/vuln/detail/CVE-2021-47321
- https://www.cve.org/CVERecord?id=CVE-2021-47321
Change history (0)
No recorded changes yet.