CVE-2022-49304 drivers: tty: serial: Fix deadlock in sa1100_set_termios()

Medium 5.5 Published Updated

A race condition in the Linux kernel's sa1100 serial driver causes a deadlock, 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-2022-49304?

CVE-2022-49304 is a medium-severity vulnerability in Linux kernel, published on 26 Feb 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:

drivers: tty: serial: Fix deadlock in sa1100_set_termios()

There is a deadlock in sa1100_set_termios(), which is shown below:

(Thread 1) | (Thread 2) | sa1100_enable_ms() sa1100_set_termios() | mod_timer() spin_lock_irqsave() //(1) | (wait a time) ... | sa1100_timeout() del_timer_sync() | spin_lock_irqsave() //(2) (wait timer to stop) | ...

We hold sport->port.lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need sport->port.lock in position (2) of thread 2. As a result, sa1100_set_termios() will block forever.

This patch moves del_timer_sync() before spin_lock_irqsave() in order to prevent the deadlock.

Weakness: CWE-667

Which versions are affected by CVE-2022-49304?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-49304?

Apply the vendor's patch.

Is CVE-2022-49304 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-49304, GHSA-6r4h-5jp9-8j35, UBUNTU-CVE-2022-49304.

Is CVE-2022-49304 in your software?

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

Check your SBOMs for free