# CVE-2022-49789: scsi: zfcp: Fix double free of FSF request when qdio send fails

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

- **Severity:** HIGH 7.0
- **CVSS:** 7.0 (v3.1, CNA) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; 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.29% (percentile 14, 2026-11-26)
- **CWE:** CWE-415
- **Published:** 2025-05-01T14:09:21.481Z
- **Modified:** 2026-08-05T08:56:19.928Z

## Who should check

- Anyone running Linux \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 1bf8ed585501bb2dd0b5f67c824eab45adfbdccd; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< d2c7d8f58e9cde8ac8d1f75e9d66c2a813ffe0ab; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 11edbdee4399401f533adda9bffe94567aa08b96; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 90a49a6b015fa439cd62e45121390284c125a91f; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 0954256e970ecf371b03a6c9af2cf91b9c4085ff
- Anyone running Linux 2.6.34

## Description

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

scsi: zfcp: Fix double free of FSF request when qdio send fails

We used to use the wrong type of integer in 'zfcp\_fsf\_req\_send()' to cache
the FSF request ID when sending a new FSF request. This is used in case the
sending fails and we need to remove the request from our internal hash
table again (so we don't keep an invalid reference and use it when we free
the request again).

In 'zfcp\_fsf\_req\_send()' we used to cache the ID as 'int' (signed and 32
bit wide), but the rest of the zfcp code (and the firmware specification)
handles the ID as 'unsigned long'/'u64' (unsigned and 64 bit wide \[s390x
ELF ABI\]).  For one this has the obvious problem that when the ID grows
past 32 bit (this can happen reasonably fast) it is truncated to 32 bit
when storing it in the cache variable and so doesn't match the original ID
anymore.  The second less obvious problem is that even when the original ID
has not yet grown past 32 bit, as soon as the 32nd bit is set in the
original ID (0x80000000 = 2'147'483'648) we will have a mismatch when we
cast it back to 'unsigned long'. As the cached variable is of a signed
type, the compiler will choose a sign-extending instruction to load the 32
bit variable into a 64 bit register (e.g.: 'lgf %r11,188(%r15)'). So once
we pass the cached variable into 'zfcp\_reqlist\_find\_rm()' to remove the
request again all the leading zeros will be flipped to ones to extend the
sign and won't match the original ID anymore (this has been observed in
practice).

If we can't successfully remove the request from the hash table again after
'zfcp\_qdio\_send()' fails (this happens regularly when zfcp cannot notify
the adapter about new work because the adapter is already gone during
e.g. a ChpID toggle) we will end up with a double free.  We unconditionally
free the request in the calling function when 'zfcp\_fsf\_req\_send()' fails,
but because the request is still in the hash table we end up with a stale
memory reference, and once the zfcp adapter is either reset during recovery
or shutdown we end up freeing the same memory twice.

The resulting stack traces vary depending on the kernel and have no direct
correlation to the place where the bug occurs. Here are three examples that
have been seen in practice:

  list\_del corruption. next-\>prev should be 00000001b9d13800, but was 00000000dead4ead. (next=00000001bd131a00)
  ------------\[ cut here \]------------
  kernel BUG at lib/list\_debug.c:62!
  monitor event: 0040 ilc:2 \[\#1\] PREEMPT SMP
  Modules linked in: ...
  CPU: 9 PID: 1617 Comm: zfcperp0.0.1740 Kdump: loaded
  Hardware name: ...
  Krnl PSW : 0704d00180000000 00000003cbeea1f8 (\_\_list\_del\_entry\_valid+0x98/0x140)
             R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 RI:0 EA:3
  Krnl GPRS: 00000000916d12f1 0000000080000000 000000000000006d 00000003cb665cd6
             0000000000000001 0000000000000000 0000000000000000 00000000d28d21e8
             00000000d3844000 00000380099efd28 00000001bd131a00 00000001b9d13800
             00000000d3290100 0000000000000000 00000003cbeea1f4 00000380099efc70
  Krnl Code: 00000003cbeea1e8: c020004f68a7        larl    %r2,00000003cc8d7336
             00000003cbeea1ee: c0e50027fd65        brasl   %r14,00000003cc3e9cb8
            \#00000003cbeea1f4: af000000            mc      0,0
            \>00000003cbeea1f8: c02000920440        larl    %r2,00000003cd12aa78
             00000003cbeea1fe: c0e500289c25        brasl   %r14,00000003cc3fda48
             00000003cbeea204: b9040043            lgr     %r4,%r3
             00000003cbeea208: b9040051            lgr     %r5,%r1
             00000003cbeea20c: b9040032            lgr     %r3,%r2
  Call Trace:
   \[\<00000003cbeea1f8\>\] \_\_list\_del\_entry\_valid+0x98/0x140
  (\[\<00000003cbeea1f4\>\] \_\_list\_del\_entry\_valid+0x94/0x140)
   \[\<000003ff7ff502fe\>\] zfcp\_fsf\_req\_dismiss\_all+0xde/0x150 \[zfcp\]
   \[\<000003ff7ff49cd0\>\] zfcp\_erp\_strategy\_do\_action+0x160/0x280 \[zfcp\]
---truncated---

## Affected and fixed versions

- Linux: \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 1bf8ed585501bb2dd0b5f67c824eab45adfbdccd; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< d2c7d8f58e9cde8ac8d1f75e9d66c2a813ffe0ab; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 11edbdee4399401f533adda9bffe94567aa08b96; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 90a49a6b015fa439cd62e45121390284c125a91f; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 0954256e970ecf371b03a6c9af2cf91b9c4085ff (cvelist)
- Linux: 2.6.34 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2022-49789.md
Affected: Linux >= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, < 1bf8ed585501bb2dd0b5f67c824eab45adfbdccd; >= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, < d2c7d8f58e9cde8ac8d1f75e9d66c2a813ffe0ab; >= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, < 11edbdee4399401f533adda9bffe94567aa08b96; >= e60a6d69f1f84c2ef1cc63a…
Fixed in: Linux 1bf8ed585501bb2dd0b5f67c824eab45adfbdccd, Linux 11edbdee4399401f533adda9bffe94567aa08b96, Linux 90a49a6b015fa439cd62e45121390284c125a91f, Linux 0954256e970ecf371b03a6c9af2cf91b9c4085ff

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

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

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

High: CVSS 7.0 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

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

Linux \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 1bf8ed585501bb2dd0b5f67c824eab45adfbdccd; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< d2c7d8f58e9cde8ac8d1f75e9d66c2a813ffe0ab; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 11edbdee4399401f533adda9bffe94567aa08b96; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 90a49a6b015fa439cd62e45121390284c125a91f; \>= e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934, \< 0954256e970ecf371b03a6c9af2cf91b9c4085ff; Linux 2.6.34.

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

Yes. Fixed in Linux 1bf8ed585501bb2dd0b5f67c824eab45adfbdccd, Linux 11edbdee4399401f533adda9bffe94567aa08b96, Linux 90a49a6b015fa439cd62e45121390284c125a91f, Linux 0954256e970ecf371b03a6c9af2cf91b9c4085ff. Upgrade Linux to 0954256e970ecf371b03a6c9af2cf91b9c4085ff or later.

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

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/1bf8ed585501bb2dd0b5f67c824eab45adfbdccd>
- patch: <https://git.kernel.org/stable/c/d2c7d8f58e9cde8ac8d1f75e9d66c2a813ffe0ab>
- patch: <https://git.kernel.org/stable/c/11edbdee4399401f533adda9bffe94567aa08b96>
- patch: <https://git.kernel.org/stable/c/90a49a6b015fa439cd62e45121390284c125a91f>
- patch: <https://git.kernel.org/stable/c/0954256e970ecf371b03a6c9af2cf91b9c4085ff>

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

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