CVE-2024-50257: netfilter: Fix use-after-free in get_info()

Published Nov 9, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

netfilter: Fix use-after-free in getinfo()

ip6tablenat module unload has refcnt warning for UAF. call trace is:

WARNING: CPU: 1 PID: 379 at kernel/module/main.c:853 moduleput+0x6f/0x80 Modules linked in: ip6tablenat(-) 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:moduleput+0x6f/0x80 Call Trace: <TASK> getinfo+0x128/0x180 doip6tgetctl+0x6a/0x430 nfgetsockopt+0x46/0x80 ipv6getsockopt+0xb9/0x100 rawv6getsockopt+0x42/0x190 dosockgetsockopt+0xaa/0x180 sysgetsockopt+0x70/0xc0 x64sysgetsockopt+0x20/0x30 dosyscall64+0xa2/0x1a0 entrySYSCALL64afterhwframe+0x77/0x7f

Concurrent execution of module unload and getinfo() trigered the warning. The root cause is as follows:

cpu0 cpu1 moduleexit //mod->state = MODULESTATEGOING ip6tablenatexit xtunregistertemplate kfree(t) //removed from templlist getinfo() t = xtfindtablelock listforeachentry(tmpl, &xttemplates[af]...) if (strcmp(tmpl->name, name)) continue; //table not found trymoduleget listforeachentry(t, &xtnet->tables[af]...) return t; //not get refcnt moduleput(t->me) //uaf unregisterpernetsubsys //remove table from xtnet list

While xttable module was going away and has been removed from xttemplates list, we couldnt get refcnt of xttable->me. Check module in xtnet->tables list re-traversal to fix it.

Other sources

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

11 affected componentsFixes available
Linux Linux kernel>=5.15<5.15.171
Linux Linux kernel>=5.16<6.1.116
Linux Linux kernel>=6.2<6.6.60
Linux Linux kernel>=6.7<6.11.7
Linux Linux kernel=6.12-rc1
Linux Linux kernel=6.12-rc2
Linux Linux kernel=6.12-rc3
Linux Linux kernel=6.12-rc4
Linux Linux kernel=6.12-rc5
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-1
debian/linux-6.1
6.1.129-1~deb11u1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1
  2. Upgrade

    Upgrade debian/linux-6.1 to a version that resolves this vulnerability.

    Fixed in 6.1.129-1~deb11u1

Event History

Nov 9, 2024
CVE Published
via MITRE·10:15 AM
Data Sourced
via MITRE·10:15 AM
DescriptionSeverity
Data Sourced
via NVD·11:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Feb 20, 2025
Data Sourced
via Launchpad·12:50 AM
Description
May 3, 2025
Data Sourced
via Ubuntu·01:07 AM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-50257?

The severity of CVE-2024-50257 is classified as medium due to the potential for use-after-free vulnerabilities in the Linux kernel.

2

How do I fix CVE-2024-50257?

To fix CVE-2024-50257, update your Linux kernel to a version that includes the security patch, such as versions 5.10.223-1, 6.1.123-1, or later.

3

Is CVE-2024-50257 present in all versions of the Linux kernel?

No, CVE-2024-50257 specifically affects certain versions of the Linux kernel within the ranges mentioned in the vulnerability report.

4

Does CVE-2024-50257 affect both IPv4 and IPv6?

CVE-2024-50257 is related to the IPv6 implementation in the Linux kernel, specifically affecting the ip6table_nat module.

5

What are the potential impacts of exploiting CVE-2024-50257?

Exploitation of CVE-2024-50257 could lead to critical system crashes or service disruptions due to the use-after-free vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203