# CVE-2022-50409: net: If sock is dead don't access sock's sk\_wq in sk\_stream\_wait\_memory

> 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.23% (percentile 8, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-09-18T16:03:53.902Z
- **Modified:** 2026-11-05T20:17:35.920Z

## Who should check

- Anyone running Linux \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< a76462dbdd8bddcbeec9463bc9e54e509b860762; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 65029aaedd15d9fe5ea1a899134e236d83f627bb; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 124b7c773271f06af5a2cea694b283cdb5275cf5; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 35f5e70bdfa7432762ac4ffa75e5a7574ac5563e; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 435f5aa4421782af197b98d8525263977be4af5c; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 3f8ef65af927db247418d4e1db49164d7a158fc5
- Anyone running Linux 4.20

## Description

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

net: If sock is dead don't access sock's sk\_wq in sk\_stream\_wait\_memory

Fixes the below NULL pointer dereference:

  \[...\]
  \[   14.471200\] Call Trace:
  \[   14.471562\]  \<TASK\>
  \[   14.471882\]  lock\_acquire+0x245/0x2e0
  \[   14.472416\]  ? remove\_wait\_queue+0x12/0x50
  \[   14.473014\]  ? \_raw\_spin\_lock\_irqsave+0x17/0x50
  \[   14.473681\]  \_raw\_spin\_lock\_irqsave+0x3d/0x50
  \[   14.474318\]  ? remove\_wait\_queue+0x12/0x50
  \[   14.474907\]  remove\_wait\_queue+0x12/0x50
  \[   14.475480\]  sk\_stream\_wait\_memory+0x20d/0x340
  \[   14.476127\]  ? do\_wait\_intr\_irq+0x80/0x80
  \[   14.476704\]  do\_tcp\_sendpages+0x287/0x600
  \[   14.477283\]  tcp\_bpf\_push+0xab/0x260
  \[   14.477817\]  tcp\_bpf\_sendmsg\_redir+0x297/0x500
  \[   14.478461\]  ? \_\_local\_bh\_enable\_ip+0x77/0xe0
  \[   14.479096\]  tcp\_bpf\_send\_verdict+0x105/0x470
  \[   14.479729\]  tcp\_bpf\_sendmsg+0x318/0x4f0
  \[   14.480311\]  sock\_sendmsg+0x2d/0x40
  \[   14.480822\]  \_\_\_\_sys\_sendmsg+0x1b4/0x1c0
  \[   14.481390\]  ? copy\_msghdr\_from\_user+0x62/0x80
  \[   14.482048\]  \_\_\_sys\_sendmsg+0x78/0xb0
  \[   14.482580\]  ? vmf\_insert\_pfn\_prot+0x91/0x150
  \[   14.483215\]  ? \_\_do\_fault+0x2a/0x1a0
  \[   14.483738\]  ? do\_fault+0x15e/0x5d0
  \[   14.484246\]  ? \_\_handle\_mm\_fault+0x56b/0x1040
  \[   14.484874\]  ? lock\_is\_held\_type+0xdf/0x130
  \[   14.485474\]  ? find\_held\_lock+0x2d/0x90
  \[   14.486046\]  ? \_\_sys\_sendmsg+0x41/0x70
  \[   14.486587\]  \_\_sys\_sendmsg+0x41/0x70
  \[   14.487105\]  ? intel\_pmu\_drain\_pebs\_core+0x350/0x350
  \[   14.487822\]  do\_syscall\_64+0x34/0x80
  \[   14.488345\]  entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd
  \[...\]

The test scenario has the following flow:

thread1                               thread2
-----------                           ---------------
 tcp\_bpf\_sendmsg
  tcp\_bpf\_send\_verdict
   tcp\_bpf\_sendmsg\_redir              sock\_close
    tcp\_bpf\_push\_locked                 \_\_sock\_release
     tcp\_bpf\_push                         //inet\_release
      do\_tcp\_sendpages                    sock-\>ops-\>release
       sk\_stream\_wait\_memory          	   // tcp\_close
          sk\_wait\_event                      sk-\>sk\_prot-\>close
           release\_sock(\_\_sk);
            \*\*\*
                                                lock\_sock(sk);
                                                  \_\_tcp\_close
                                                    sock\_orphan(sk)
                                                      sk-\>sk\_wq  = NULL
                                                release\_sock
            \*\*\*\*
           lock\_sock(\_\_sk);
          remove\_wait\_queue(sk\_sleep(sk), &wait);
             sk\_sleep(sk)
             //NULL pointer dereference
             &rcu\_dereference\_raw(sk-\>sk\_wq)-\>wait

While waiting for memory in thread1, the socket is released with its wait
queue because thread2 has closed it. This caused by tcp\_bpf\_send\_verdict
didn't increase the f\_count of psock-\>sk\_redir-\>sk\_socket-\>file in thread1.

We should check if SOCK\_DEAD flag is set on wakeup in sk\_stream\_wait\_memory
before accessing the wait queue.

## Affected and fixed versions

- Linux: \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< a76462dbdd8bddcbeec9463bc9e54e509b860762; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 65029aaedd15d9fe5ea1a899134e236d83f627bb; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 124b7c773271f06af5a2cea694b283cdb5275cf5; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 35f5e70bdfa7432762ac4ffa75e5a7574ac5563e; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 435f5aa4421782af197b98d8525263977be4af5c; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 3f8ef65af927db247418d4e1db49164d7a158fc5 (cvelist)
- Linux: 4.20 (cvelist)

## Mitigation

- Upgrade Linux to 3f8ef65af927db247418d4e1db49164d7a158fc5 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-50409. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50409.md
Affected: Linux >= 604326b41a6fb9b4a78b6179335decee0365cd8c, < a76462dbdd8bddcbeec9463bc9e54e509b860762; >= 604326b41a6fb9b4a78b6179335decee0365cd8c, < 65029aaedd15d9fe5ea1a899134e236d83f627bb; >= 604326b41a6fb9b4a78b6179335decee0365cd8c, < 124b7c773271f06af5a2cea694b283cdb5275cf5; >= 604326b41a6fb9b4a78b617…
Fixed in: Linux 65029aaedd15d9fe5ea1a899134e236d83f627bb, Linux 124b7c773271f06af5a2cea694b283cdb5275cf5, Linux 35f5e70bdfa7432762ac4ffa75e5a7574ac5563e, Linux 435f5aa4421782af197b98d8525263977be4af5c, Linux 3f8ef65af927db247418d4e1db49164d7a158fc5

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

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

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

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

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

Linux \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< a76462dbdd8bddcbeec9463bc9e54e509b860762; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 65029aaedd15d9fe5ea1a899134e236d83f627bb; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 124b7c773271f06af5a2cea694b283cdb5275cf5; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 35f5e70bdfa7432762ac4ffa75e5a7574ac5563e; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 435f5aa4421782af197b98d8525263977be4af5c; \>= 604326b41a6fb9b4a78b6179335decee0365cd8c, \< 3f8ef65af927db247418d4e1db49164d7a158fc5; Linux 4.20.

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

Yes. Fixed in Linux 65029aaedd15d9fe5ea1a899134e236d83f627bb, Linux 124b7c773271f06af5a2cea694b283cdb5275cf5, Linux 35f5e70bdfa7432762ac4ffa75e5a7574ac5563e, Linux 435f5aa4421782af197b98d8525263977be4af5c, Linux 3f8ef65af927db247418d4e1db49164d7a158fc5. Upgrade Linux to 3f8ef65af927db247418d4e1db49164d7a158fc5 or later.

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

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/a76462dbdd8bddcbeec9463bc9e54e509b860762>
- patch: <https://git.kernel.org/stable/c/65029aaedd15d9fe5ea1a899134e236d83f627bb>
- patch: <https://git.kernel.org/stable/c/124b7c773271f06af5a2cea694b283cdb5275cf5>
- patch: <https://git.kernel.org/stable/c/35f5e70bdfa7432762ac4ffa75e5a7574ac5563e>
- patch: <https://git.kernel.org/stable/c/435f5aa4421782af197b98d8525263977be4af5c>
- patch: <https://git.kernel.org/stable/c/3f8ef65af927db247418d4e1db49164d7a158fc5>

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

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