CVE-2022-50421 rpmsg: char: Avoid double destroy of default endpoint

High 7.8 Published Updated

A use-after-free vulnerability in the Linux kernel rpmsg driver allows attackers to cause a denial of service or potentially execute code via double destruction of an endpoint.

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-2022-50421?

CVE-2022-50421 is a high-severity use after free vulnerability in Linux kernel, published on 1 Oct 2025. 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:

rpmsg: char: Avoid double destroy of default endpoint

The rpmsg_dev_remove() in rpmsg_core is the place for releasing this default endpoint.

So need to avoid destroying the default endpoint in rpmsg_chrdev_eptdev_destroy(), this should be the same as rpmsg_eptdev_release(). Otherwise there will be double destroy issue that ept->refcount report warning:

refcount_t: underflow; use-after-free.

Call trace: refcount_warn_saturate+0xf8/0x150 virtio_rpmsg_destroy_ept+0xd4/0xec rpmsg_dev_remove+0x60/0x70

The issue can be reproduced by stopping remoteproc before closing the /dev/rpmsgX.

Weakness: CWE-416

Which versions are affected by CVE-2022-50421?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-50421?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2022-50421 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-50421, GHSA-7gv2-7hhr-4fm9, UBUNTU-CVE-2022-50421.

Is CVE-2022-50421 in your software?

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

Check your SBOMs for free