CVE-2024-53211 net/l2tp: fix warning in l2tp_exit_net found by syzbot

Medium 5.5 Published Updated

A logic error in the Linux kernel L2TP module can trigger a warning and potential instability during network namespace exit, leading to 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-53211?

CVE-2024-53211 is a medium-severity denial of service vulnerability in Linux kernel, published on 27 Dec 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:

net/l2tp: fix warning in l2tp_exit_net found by syzbot

In l2tp's net exit handler, we check that an IDR is empty before destroying it:

WARN_ON_ONCE(!idr_is_empty(&pn->l2tp_tunnel_idr)); idr_destroy(&pn->l2tp_tunnel_idr);

By forcing memory allocation failures in idr_alloc_32, syzbot is able to provoke a condition where idr_is_empty returns false despite there being no items in the IDR. This turns out to be because the radix tree of the IDR contains only internal radix-tree nodes and it is this that causes idr_is_empty to return false. The internal nodes are cleaned by idr_destroy.

Use idr_for_each to check that the IDR is empty instead of idr_is_empty to avoid the problem.

Which versions are affected by CVE-2024-53211?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-53211?

Apply the vendor's patch.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2024-53211 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-53211, DEBIAN-CVE-2024-53211, GHSA-f4g2-c45m-rq74, UBUNTU-CVE-2024-53211.

Is CVE-2024-53211 in your software?

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

Check your SBOMs for free