# CVE-2022-49018: mptcp: fix sleep in atomic at close time

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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.20% (percentile 6, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2024-10-21T20:06:26.627Z
- **Modified:** 2026-06-17T05:16:51.703Z

## Who should check

- Anyone running Linux \>= 30e51b923e436b631e8d5b77fa5e318c6b066dc7, \< d8e6c5500dbf0f3e87aace90d4beba6ae928e866; \>= 30e51b923e436b631e8d5b77fa5e318c6b066dc7, \< b4f166651d03b5484fa179817ba8ad4899a5a6ac; b41808bfa049d1bc7ce8ce1ad4d591f7d203ebb9; \>= 5.19.14, \< 5.20
- Anyone running Linux 6.0

## Description

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

mptcp: fix sleep in atomic at close time

Matt reported a splat at msk close time:

    BUG: sleeping function called from invalid context at net/mptcp/protocol.c:2877
    in\_atomic(): 1, irqs\_disabled(): 0, non\_block: 0, pid: 155, name: packetdrill
    preempt\_count: 201, expected: 0
    RCU nest depth: 0, expected: 0
    4 locks held by packetdrill/155:
    \#0: ffff888001536990 (&sb-\>s\_type-\>i\_mutex\_key\#6){+.+.}-{3:3}, at: \_\_sock\_release (net/socket.c:650)
    \#1: ffff88800b498130 (sk\_lock-AF\_INET){+.+.}-{0:0}, at: mptcp\_close (net/mptcp/protocol.c:2973)
    \#2: ffff88800b49a130 (sk\_lock-AF\_INET/1){+.+.}-{0:0}, at: \_\_mptcp\_close\_ssk (net/mptcp/protocol.c:2363)
    \#3: ffff88800b49a0b0 (slock-AF\_INET){+...}-{2:2}, at: \_\_lock\_sock\_fast (include/net/sock.h:1820)
    Preemption disabled at:
    0x0
    CPU: 1 PID: 155 Comm: packetdrill Not tainted 6.1.0-rc5 \#365
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
    Call Trace:
    \<TASK\>
    dump\_stack\_lvl (lib/dump\_stack.c:107 (discriminator 4))
    \_\_might\_resched.cold (kernel/sched/core.c:9891)
    \_\_mptcp\_destroy\_sock (include/linux/kernel.h:110)
    \_\_mptcp\_close (net/mptcp/protocol.c:2959)
    mptcp\_subflow\_queue\_clean (include/net/sock.h:1777)
    \_\_mptcp\_close\_ssk (net/mptcp/protocol.c:2363)
    mptcp\_destroy\_common (net/mptcp/protocol.c:3170)
    mptcp\_destroy (include/net/sock.h:1495)
    \_\_mptcp\_destroy\_sock (net/mptcp/protocol.c:2886)
    \_\_mptcp\_close (net/mptcp/protocol.c:2959)
    mptcp\_close (net/mptcp/protocol.c:2974)
    inet\_release (net/ipv4/af\_inet.c:432)
    \_\_sock\_release (net/socket.c:651)
    sock\_close (net/socket.c:1367)
    \_\_fput (fs/file\_table.c:320)
    task\_work\_run (kernel/task\_work.c:181 (discriminator 1))
    exit\_to\_user\_mode\_prepare (include/linux/resume\_user\_mode.h:49)
    syscall\_exit\_to\_user\_mode (kernel/entry/common.c:130)
    do\_syscall\_64 (arch/x86/entry/common.c:87)
    entry\_SYSCALL\_64\_after\_hwframe (arch/x86/entry/entry\_64.S:120)

We can't call mptcp\_close under the 'fast' socket lock variant, replace
it with a sock\_lock\_nested() as the relevant code is already under the
listening msk socket lock protection.

## Affected and fixed versions

- Linux: \>= 30e51b923e436b631e8d5b77fa5e318c6b066dc7, \< d8e6c5500dbf0f3e87aace90d4beba6ae928e866; \>= 30e51b923e436b631e8d5b77fa5e318c6b066dc7, \< b4f166651d03b5484fa179817ba8ad4899a5a6ac; b41808bfa049d1bc7ce8ce1ad4d591f7d203ebb9; \>= 5.19.14, \< 5.20 (cvelist)
- Linux: 6.0 (cvelist)

## Mitigation

- Upgrade Linux to 5.20 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-49018.md
Affected: Linux >= 30e51b923e436b631e8d5b77fa5e318c6b066dc7, < d8e6c5500dbf0f3e87aace90d4beba6ae928e866; >= 30e51b923e436b631e8d5b77fa5e318c6b066dc7, < b4f166651d03b5484fa179817ba8ad4899a5a6ac; b41808bfa049d1bc7ce8ce1ad4d591f7d203ebb9; >= 5.19.14, < 5.20; Linux 6.0
Fixed in: Linux 5.20

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-49018 being exploited?

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

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

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 30e51b923e436b631e8d5b77fa5e318c6b066dc7, \< d8e6c5500dbf0f3e87aace90d4beba6ae928e866; \>= 30e51b923e436b631e8d5b77fa5e318c6b066dc7, \< b4f166651d03b5484fa179817ba8ad4899a5a6ac; b41808bfa049d1bc7ce8ce1ad4d591f7d203ebb9; \>= 5.19.14, \< 5.20; Linux 6.0.

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

Yes. Fixed in Linux 5.20. Upgrade Linux to 5.20 or later.

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

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/d8e6c5500dbf0f3e87aace90d4beba6ae928e866>
- patch: <https://git.kernel.org/stable/c/b4f166651d03b5484fa179817ba8ad4899a5a6ac>

## 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-49018>

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