CVE-2024-38612 ipv6: sr: fix invalid unregister error path

High 7.0 Published Updated

A missing unregister call in the Linux kernel IPv6 Segment Routing error path can cause a null pointer dereference or use-after-free, leading to a denial of service.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-38612?

CVE-2024-38612 is a high-severity vulnerability in Linux kernel, published on 19 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

ipv6: sr: fix invalid unregister error path

The error path of seg6_init() is wrong in case CONFIG_IPV6_SEG6_LWTUNNEL is not defined. In that case if seg6_hmac_init() fails, the genl_unregister_family() isn't called.

This issue exist since commit 46738b1317e1 ("ipv6: sr: add option to control lwtunnel support"), and commit 5559cea2d5aa ("ipv6: sr: fix possible use-after-free and null-ptr-deref") replaced unregister_pernet_subsys() with genl_unregister_family() in this error path.

Weakness: CWE-476, CWE-416

Which versions are affected by CVE-2024-38612?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-38612?

Apply the vendor's patch.

Is CVE-2024-38612 being exploited?

There is no known exploitation of CVE-2024-38612 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-38612, DEBIAN-CVE-2024-38612, GHSA-r6h6-9448-4q2f, UBUNTU-CVE-2024-38612.

Is CVE-2024-38612 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free