Overview
About vulnerability
In the Linux kernel, the following vulnerability has been resolved:
kprobes: Fix possible use-after-free issue on kprobe registration
When unloading a module, its state is changing MODULE_STATE_LIVE ->
MODULE_STATE_GOING -> MODULE_STATE_UNFORMED. Each change will take
a time. is_module_text_address() and __module_text_address()
works with MODULE_STATE_LIVE and MODULE_STATE_GOING.
If we use is_module_text_address() and __module_text_address()
separately, there is a chance that the first one is succeeded but the
next one is failed because module->state becomes MODULE_STATE_UNFORMED
between those operations.
In check_kprobe_address_safe(), if the second __module_text_address()
is failed, that is ignored because it expected a kernel_text address.
But it may have failed simply because module->state has been changed
to MODULE_STATE_UNFORMED. In this case, arm_kprobe() will try to modify
non-exist module text address (use-after-free).
To fix this problem, we should not use separated is_module_text_address()
and __module_text_address(), but use only __module_text_address()
once and do try_module_get(module) which is only available with
MODULE_STATE_LIVE.
Details
- Affected product:
- Debian 10 ELS , Ubuntu 16.04 ELS , Ubuntu 18.04 ELS
- Affected packages:
- linux-hwe @ 4.15.0 (+3 more)
Fixes
KernelCare state
Live-patch status from KernelCare for each operating system.
| Operating system | Status | Covered kernels |
|---|---|---|
| Amazon Linux 2 | Released |
37 kernels
|
| Amazon Linux 2023 | Planned | — |
| Amazon Linux 2 5.10 | Will Not Fix | — |
| Amazon Linux 2 5.4 | Will Not Fix | — |
| Debian 10 | Will Not Fix | — |
| Debian 10 cloud | Will Not Fix | — |
| Debian 11 | Planned | — |
| Proxmox VE 7 5.15 | Released |
45 kernels
|
| Ubuntu 16.04 AWS HWE ESM | Will Not Fix | — |
| Ubuntu 16.04 Azure ESM | Will Not Fix | — |
| Ubuntu 16.04 HWE ESM | Will Not Fix | — |
| Ubuntu 18.04 | Will Not Fix | — |
| Ubuntu 18.04 AWS Focal | Released |
56 kernels
|
| Ubuntu 18.04 HWE Focal | Released |
69 kernels
|
| Ubuntu 20.04 | Released |
110 kernels
|
| Ubuntu 20.04 AWS | Released |
93 kernels
|
| Ubuntu 20.04 Azure | Released |
84 kernels
|
| Ubuntu 20.04 GCP | Planned | — |
| Ubuntu 20.04 HWE AWS | Released |
41 kernels
|
| Ubuntu 20.04 HWE Azure | Released |
25 kernels
|
| Ubuntu 22.04 | Released |
54 kernels
|
| Ubuntu 22.04 AWS | Released |
48 kernels
|
| Ubuntu 22.04 Azure | Released |
45 kernels
|
| Ubuntu 24.04 | Planned | — |