CVE-2022-48989 fscache: Fix oops due to race with cookie_lru and use_cookie

High 7.8 Published Updated

A race condition in the Linux kernel fscache subsystem allows a local attacker to trigger a NULL pointer dereference, causing a system crash.

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-48989?

CVE-2022-48989 is a high-severity vulnerability in Linux kernel, published on 21 Oct 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:

fscache: Fix oops due to race with cookie_lru and use_cookie

If a cookie expires from the LRU and the LRU_DISCARD flag is set, but the state machine has not run yet, it's possible another thread can call fscache_use_cookie and begin to use it.

When the cookie_worker finally runs, it will see the LRU_DISCARD flag set, transition the cookie->state to LRU_DISCARDING, which will then withdraw the cookie. Once the cookie is withdrawn the object is removed the below oops will occur because the object associated with the cookie is now NULL.

Fix the oops by clearing the LRU_DISCARD bit if another thread uses the cookie before the cookie_worker runs.

BUG: kernel NULL pointer dereference, address: 0000000000000008 ... CPU: 31 PID: 44773 Comm: kworker/u130:1 Tainted: G E 6.0.0-5.dneg.x86_64 #1 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Workqueue: events_unbound netfs_rreq_write_to_cache_work [netfs] RIP: 0010:cachefiles_prepare_write+0x28/0x90 [cachefiles] ... Call Trace: netfs_rreq_write_to_cache_work+0x11c/0x320 [netfs] process_one_work+0x217/0x3e0 worker_thread+0x4a/0x3b0 kthread+0xd6/0x100

Weakness: CWE-362

Which versions are affected by CVE-2022-48989?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-48989?

Apply the vendor's patch.

Is CVE-2022-48989 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-48989, GHSA-29wh-8w97-366v, UBUNTU-CVE-2022-48989.

Is CVE-2022-48989 in your software?

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

Check your SBOMs for free