Skip to content
8.8 High

CVE-2024-35955 In the Linux kernel, the following vulnerability has been resolved: kprobes: Fix possible use-after-free issue on kprobe…

Description

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.

Affected products and versions

Product Affected versions Fixed in
Linux 6.9 earliest → < 6.9 6.9
Linux 6.8 earliest → < 6.8.7 6.8.7
Linux 6.6 earliest → < 6.6.28 6.6.28
Linux 6.1 earliest → < 6.1.87 6.1.87
Linux 6.0 No fix stated
Linux 5.15 earliest → < 5.15.157 5.15.157
Linux 5.10 earliest → < 5.10.216 5.10.216
Linux 5.4 earliest → < 5.4.275 5.4.275
Linux 4.19 earliest → < 4.19.313 4.19.313
Show the 5 other branches
Product Affected versions Fixed in
linux_kernel 6.0 No fix stated
RUGGEDCOM RST2428P 3.1 earliest → < 3.1 3.1
SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 family Versions not published
SCALANCE XCM-/XRM-/XCH-/XRH-300 family 3.1 earliest → < 3.1 3.1
SIMATIC S7-1500 TM MFP - GNU/Linux subsystem 1.1 earliest → < 1.1.1 1.1.1

References

Timeline

  1. Published
  2. Last modified
The 18283 CVEs of Linux →
Track this CVE