Linux: Use After Free
CVE-2024-50257 is a high-severity use after free vulnerability in Linux, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions ba22ea01348384df19cc1fabc7964be6e7189749, cb7c388b5967946f097afdb759b7c860305f2d96, 6a1f088f9807f5166f58902d26246d0b88da03a8 as the first without the flaw, so updating Linux to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.26% chance of exploitation within 30 days, which is low compared with other CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update Linux to ba22ea01348384df19cc1fabc7964be6e7189749 or cb7c388b5967946f097afdb759b7c860305f2d96 or 6a1f088f9807f5166f58902d26246d0b88da03a8 or bab3bb35c03b263c486833d50d50c081d9e9832b, whichever matches your release line, or a later version.
- Update Linux Kernel to 5.15.171 or 6.1.116 or 6.6.60 or 6.11.7, whichever matches your release line, or a later version.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Linux | Linux | fdacd57c79b79a03c7ca88f706ad9fb7b46831c1 up to, but not including, ba22ea01348384df19cc1fabc7964be6e7189749; fdacd57c79b79a03c7ca88f706ad9fb7b46831c1 up to, but not including, cb7c388b5967946f097afdb759b7c860305f2d96; fdacd57c79b79a03c7ca88f706ad9fb7b46831c1 up to, but not including, 6a1f088f9807f5166f58902d26246d0b88da03a8; fdacd57c79b79a03c7ca88f706ad9fb7b46831c1 up to, but not including, bab3bb35c03b263c486833d50d50c081d9e9832b; fdacd57c79b79a03c7ca88f706ad9fb7b46831c1 up to, but not including, f48d258f0ac540f00fa617dac496c4c18b5dc2fa; 5.15 | ba22ea01348384df19cc1fabc7964be6e7189749, cb7c388b5967946f097afdb759b7c860305f2d96, 6a1f088f9807f5166f58902d26246d0b88da03a8, bab3bb35c03b263c486833d50d50c081d9e9832b, f48d258f0ac540f00fa617dac496c4c18b5dc2fa |
| Linux | Linux Kernel | 5.15 up to, but not including, 5.15.171; 5.16 up to, but not including, 6.1.116; 6.2 up to, but not including, 6.6.60; 6.7 up to, but not including, 6.11.7; 6.12 | 5.15.171, 6.1.116, 6.6.60, 6.11.7 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- LocalThe attacker needs local access or must trick a user into running something.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- LowA basic user account is enough.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 7.0 | High | CNA |
| CVSS 3.1 | 7.8 | High | NVD |
| CVSS 3.1 | 7.8 | High | CISA (ADP) |
Official description
In the Linux kernel, the following vulnerability has been resolved: netfilter: Fix use-after-free in get_info() ip6table_nat module unload has refcnt warning for UAF. call trace is: WARNING: CPU: 1 PID: 379 at kernel/module/main.c:853 module_put+0x6f/0x80 Modules linked in: ip6table_nat(-) CPU: 1 UID: 0 PID: 379 Comm: ip6tables Not tainted 6.12.0-rc4-00047-gc2ee9f594da8-dirty #205 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:module_put+0x6f/0x80 Call Trace: <TASK> get_info+0x128/0x180 do_ip6t_get_ctl+0x6a/0x430 nf_getsockopt+0x46/0x80 ipv6_getsockopt+0xb9/0x100 rawv6_getsockopt+0x42/0x190 do_sock_getsockopt+0xaa/0x180 __sys_getsockopt+0x70/0xc0 __x64_sys_getsockopt+0x20/0x30 do_syscall_64+0xa2/0x1a0 entry_SYSCALL_64_after_hwframe+0x77/0x7f Concurrent execution of module unload and get_info() trigered the warning. The root cause is as follows: cpu0 cpu1 module_exit //mod->state = MODULE_STATE_GOING ip6table_nat_exit xt_unregister_template kfree(t) //removed from templ_list getinfo() t = xt_find_table_lock list_for_each_entry(tmpl, &xt_templates[af]...) if (strcmp(tmpl->name, name)) continue; //table not found try_module_get list_for_each_entry(t, &xt_net->tables[af]...) return t; //not get refcnt module_put(t->me) //uaf unregister_pernet_subsys //remove table from xt_net list While xt_table module was going away and has been removed from xt_templates list, we couldnt get refcnt of xt_table->me. Check module in xt_net->tables list re-traversal to fix it.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory belongs to the code that operates on the new pointer.
How developers prevent this class of flaw
- Choose a language that provides automatic memory management.
- When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- git.kernel.org/stable/c/6a1f088f9807f5166f58902d26246d0b88da03a8
- git.kernel.org/stable/c/ba22ea01348384df19cc1fabc7964be6e7189749
- git.kernel.org/stable/c/bab3bb35c03b263c486833d50d50c081d9e9832b
- git.kernel.org/stable/c/cb7c388b5967946f097afdb759b7c860305f2d96
- git.kernel.org/stable/c/f48d258f0ac540f00fa617dac496c4c18b5dc2fa
Other references
Recent Use After Free vulnerabilities
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.0 High severity
- 7.8 High severity
Spotted an error? Tell us.