CVE-2022-50422 scsi: libsas: Fix use-after-free bug in smp_execute_task_sg()
A use-after-free vulnerability in the Linux kernel's SAS subsystem allows attackers to potentially execute code or escalate privileges via a race condition.
- 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-50422?
CVE-2022-50422 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:
scsi: libsas: Fix use-after-free bug in smp_execute_task_sg()
When executing SMP task failed, the smp_execute_task_sg() calls del_timer() to delete "slow_task->timer". However, if the timer handler sas_task_internal_timedout() is running, the del_timer() in smp_execute_task_sg() will not stop it and a UAF will happen. The process is shown below:
(thread 1) | (thread 2) smp_execute_task_sg() | sas_task_internal_timedout() ... | del_timer() | ... | ... sas_free_task(task) | kfree(task->slow_task) //FREE| | task->slow_task->... //USE
Fix by calling del_timer_sync() in smp_execute_task_sg(), which makes sure the timer handler have finished before the "task->slow_task" is deallocated.
Weakness: CWE-416
Which versions are affected by CVE-2022-50422?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2022-50422?
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-50422 being exploited?
There is no known exploitation of CVE-2022-50422 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as DEBIAN-CVE-2022-50422, GHSA-j5vv-gj42-cwrm, UBUNTU-CVE-2022-50422.