# CVE-2022-49059: nfc: nci: add flush\_workqueue to prevent uaf

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-02-26T01:54:29.819Z
- **Modified:** 2026-06-17T05:16:57.833Z

## Who should check

- Anyone running Linux \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 7d3232214ca4ea8f7d18df264c3b254aa8089d7f; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 9d243aff5f7e6b04e907c617426bbdf26e996ac8; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 1a1748d0dd0f0a98535c6baeef671c8722107639; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 5c63ad2b0a267a524c12c88acb1ba9c2d109a801; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 67677050cecbe0edfdd81cd508415e9636ba7c65; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 9ded5ae40f4fe37fcc28f36d76bf45df20be5432; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< edd4600120641e1714e30112e69a548cfb68e067; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< ef27324e2cb7bb24542d6cb2571740eefe6b00dc
- Anyone running Linux 3.2

## Description

In the Linux kernel, the following vulnerability has been resolved:

nfc: nci: add flush\_workqueue to prevent uaf

Our detector found a concurrent use-after-free bug when detaching an
NCI device. The main reason for this bug is the unexpected scheduling
between the used delayed mechanism (timer and workqueue).

The race can be demonstrated below:

Thread-1                           Thread-2
                                 \| nci\_dev\_up()
                                 \|   nci\_open\_device()
                                 \|     \_\_nci\_request(nci\_reset\_req)
                                 \|       nci\_send\_cmd
                                 \|         queue\_work(cmd\_work)
nci\_unregister\_device()          \|
  nci\_close\_device()             \| ...
    del\_timer\_sync(cmd\_timer)\[1\] \|
...                              \| Worker
nci\_free\_device()                \| nci\_cmd\_work()
  kfree(ndev)\[3\]                 \|   mod\_timer(cmd\_timer)\[2\]

In short, the cleanup routine thought that the cmd\_timer has already
been detached by \[1\] but the mod\_timer can re-attach the timer \[2\], even
it is already released \[3\], resulting in UAF.

This UAF is easy to trigger, crash trace by POC is like below

\[   66.703713\] ==================================================================
\[   66.703974\] BUG: KASAN: use-after-free in enqueue\_timer+0x448/0x490
\[   66.703974\] Write of size 8 at addr ffff888009fb7058 by task kworker/u4:1/33
\[   66.703974\]
\[   66.703974\] CPU: 1 PID: 33 Comm: kworker/u4:1 Not tainted 5.18.0-rc2 \#5
\[   66.703974\] Workqueue: nfc2\_nci\_cmd\_wq nci\_cmd\_work
\[   66.703974\] Call Trace:
\[   66.703974\]  \<TASK\>
\[   66.703974\]  dump\_stack\_lvl+0x57/0x7d
\[   66.703974\]  print\_report.cold+0x5e/0x5db
\[   66.703974\]  ? enqueue\_timer+0x448/0x490
\[   66.703974\]  kasan\_report+0xbe/0x1c0
\[   66.703974\]  ? enqueue\_timer+0x448/0x490
\[   66.703974\]  enqueue\_timer+0x448/0x490
\[   66.703974\]  \_\_mod\_timer+0x5e6/0xb80
\[   66.703974\]  ? mark\_held\_locks+0x9e/0xe0
\[   66.703974\]  ? try\_to\_del\_timer\_sync+0xf0/0xf0
\[   66.703974\]  ? lockdep\_hardirqs\_on\_prepare+0x17b/0x410
\[   66.703974\]  ? queue\_work\_on+0x61/0x80
\[   66.703974\]  ? lockdep\_hardirqs\_on+0xbf/0x130
\[   66.703974\]  process\_one\_work+0x8bb/0x1510
\[   66.703974\]  ? lockdep\_hardirqs\_on\_prepare+0x410/0x410
\[   66.703974\]  ? pwq\_dec\_nr\_in\_flight+0x230/0x230
\[   66.703974\]  ? rwlock\_bug.part.0+0x90/0x90
\[   66.703974\]  ? \_raw\_spin\_lock\_irq+0x41/0x50
\[   66.703974\]  worker\_thread+0x575/0x1190
\[   66.703974\]  ? process\_one\_work+0x1510/0x1510
\[   66.703974\]  kthread+0x2a0/0x340
\[   66.703974\]  ? kthread\_complete\_and\_exit+0x20/0x20
\[   66.703974\]  ret\_from\_fork+0x22/0x30
\[   66.703974\]  \</TASK\>
\[   66.703974\]
\[   66.703974\] Allocated by task 267:
\[   66.703974\]  kasan\_save\_stack+0x1e/0x40
\[   66.703974\]  \_\_kasan\_kmalloc+0x81/0xa0
\[   66.703974\]  nci\_allocate\_device+0xd3/0x390
\[   66.703974\]  nfcmrvl\_nci\_register\_dev+0x183/0x2c0
\[   66.703974\]  nfcmrvl\_nci\_uart\_open+0xf2/0x1dd
\[   66.703974\]  nci\_uart\_tty\_ioctl+0x2c3/0x4a0
\[   66.703974\]  tty\_ioctl+0x764/0x1310
\[   66.703974\]  \_\_x64\_sys\_ioctl+0x122/0x190
\[   66.703974\]  do\_syscall\_64+0x3b/0x90
\[   66.703974\]  entry\_SYSCALL\_64\_after\_hwframe+0x44/0xae
\[   66.703974\]
\[   66.703974\] Freed by task 406:
\[   66.703974\]  kasan\_save\_stack+0x1e/0x40
\[   66.703974\]  kasan\_set\_track+0x21/0x30
\[   66.703974\]  kasan\_set\_free\_info+0x20/0x30
\[   66.703974\]  \_\_kasan\_slab\_free+0x108/0x170
\[   66.703974\]  kfree+0xb0/0x330
\[   66.703974\]  nfcmrvl\_nci\_unregister\_dev+0x90/0xd0
\[   66.703974\]  nci\_uart\_tty\_close+0xdf/0x180
\[   66.703974\]  tty\_ldisc\_kill+0x73/0x110
\[   66.703974\]  tty\_ldisc\_hangup+0x281/0x5b0
\[   66.703974\]  \_\_tty\_hangup.part.0+0x431/0x890
\[   66.703974\]  tty\_release+0x3a8/0xc80
\[   66.703974\]  \_\_fput+0x1f0/0x8c0
\[   66.703974\]  task\_work\_run+0xc9/0x170
\[   66.703974\]  exit\_to\_user\_mode\_prepare+0x194/0x1a0
\[   66.703974\]  syscall\_exit\_to\_user\_mode+0x19/0x50
\[   66.703974\]  do\_syscall\_64+0x48/0x90
\[   66.703974\]  entry\_SYSCALL\_64\_after\_hwframe+0x44/0x
---truncated---

## Affected and fixed versions

- Linux: \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 7d3232214ca4ea8f7d18df264c3b254aa8089d7f; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 9d243aff5f7e6b04e907c617426bbdf26e996ac8; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 1a1748d0dd0f0a98535c6baeef671c8722107639; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 5c63ad2b0a267a524c12c88acb1ba9c2d109a801; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 67677050cecbe0edfdd81cd508415e9636ba7c65; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 9ded5ae40f4fe37fcc28f36d76bf45df20be5432; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< edd4600120641e1714e30112e69a548cfb68e067; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< ef27324e2cb7bb24542d6cb2571740eefe6b00dc (cvelist)
- Linux: 3.2 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49059. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49059.md
Affected: Linux >= 6a2968aaf50c7a22fced77a5e24aa636281efca8, < 7d3232214ca4ea8f7d18df264c3b254aa8089d7f; >= 6a2968aaf50c7a22fced77a5e24aa636281efca8, < 9d243aff5f7e6b04e907c617426bbdf26e996ac8; >= 6a2968aaf50c7a22fced77a5e24aa636281efca8, < 1a1748d0dd0f0a98535c6baeef671c8722107639; >= 6a2968aaf50c7a22fced77a…
Fixed in: Linux 7d3232214ca4ea8f7d18df264c3b254aa8089d7f, Linux 9d243aff5f7e6b04e907c617426bbdf26e996ac8, Linux 1a1748d0dd0f0a98535c6baeef671c8722107639, Linux 5c63ad2b0a267a524c12c88acb1ba9c2d109a801, Linux 67677050cecbe0edfdd81cd508415e9636ba7c65, Linux 9ded5ae40f4fe37fcc28f36d76bf45df20be5432

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-49059 being exploited?

There is no confirmed exploitation: CVE-2022-49059 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-49059?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49059?

Linux \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 7d3232214ca4ea8f7d18df264c3b254aa8089d7f; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 9d243aff5f7e6b04e907c617426bbdf26e996ac8; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 1a1748d0dd0f0a98535c6baeef671c8722107639; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 5c63ad2b0a267a524c12c88acb1ba9c2d109a801; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 67677050cecbe0edfdd81cd508415e9636ba7c65; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< 9ded5ae40f4fe37fcc28f36d76bf45df20be5432; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< edd4600120641e1714e30112e69a548cfb68e067; \>= 6a2968aaf50c7a22fced77a5e24aa636281efca8, \< ef27324e2cb7bb24542d6cb2571740eefe6b00dc; Linux 3.2.

### Is there a fix for CVE-2022-49059?

Yes. Fixed in Linux 7d3232214ca4ea8f7d18df264c3b254aa8089d7f, Linux 9d243aff5f7e6b04e907c617426bbdf26e996ac8, Linux 1a1748d0dd0f0a98535c6baeef671c8722107639, Linux 5c63ad2b0a267a524c12c88acb1ba9c2d109a801, Linux 67677050cecbe0edfdd81cd508415e9636ba7c65, Linux 9ded5ae40f4fe37fcc28f36d76bf45df20be5432. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-49059?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/7d3232214ca4ea8f7d18df264c3b254aa8089d7f>
- patch: <https://git.kernel.org/stable/c/9d243aff5f7e6b04e907c617426bbdf26e996ac8>
- patch: <https://git.kernel.org/stable/c/1a1748d0dd0f0a98535c6baeef671c8722107639>
- patch: <https://git.kernel.org/stable/c/5c63ad2b0a267a524c12c88acb1ba9c2d109a801>
- patch: <https://git.kernel.org/stable/c/67677050cecbe0edfdd81cd508415e9636ba7c65>
- patch: <https://git.kernel.org/stable/c/9ded5ae40f4fe37fcc28f36d76bf45df20be5432>
- patch: <https://git.kernel.org/stable/c/edd4600120641e1714e30112e69a548cfb68e067>
- patch: <https://git.kernel.org/stable/c/ef27324e2cb7bb24542d6cb2571740eefe6b00dc>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-49059>

HTML: <https://flawdb.com/CVE-2022-49059> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-49059>
