# CVE-2022-50506: drbd: only clone bio if we have a backing device

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.14%, higher than 3% of CVEs (2026-12-01)
- Published: 2025-10-04T15:43:54.955Z
- Modified: 2026-06-17T05:23:41.180Z
- Weaknesses: CWE-476
- Assigned by: Linux

## Description

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

drbd: only clone bio if we have a backing device

Commit c347a787e34cb (drbd: set ->bi_bdev in drbd_req_new) moved a
bio_set_dev call (which has since been removed) to "earlier", from
drbd_request_prepare to drbd_req_new.

The problem is that this accesses device->ldev->backing_bdev, which is
not NULL-checked at this point. When we don't have an ldev (i.e. when
the DRBD device is diskless), this leads to a null pointer deref.

So, only allocate the private_bio if we actually have a disk. This is
also a small optimization, since we don't clone the bio to only to
immediately free it again in the diskless case.

(As written by CVE List.)

## Affected

- Linux Linux: from c347a787e34cba0e5a80a04082dacaf259105605 before 05580a3bbf3cec677cb00a85dfeb21d6a9b48eaf; from c347a787e34cba0e5a80a04082dacaf259105605 before 6d42ddf7f27b6723549ee6d4c8b1b418b59bf6b5; 5.18 (not affected: before 5.18; from 6.0.6 up to 6.0.*; from 6.1 up to *)
- linux linux_kernel: from 5.18 before 6.0.6; 6.1

## References

- <https://git.kernel.org/stable/c/05580a3bbf3cec677cb00a85dfeb21d6a9b48eaf> (patch)
- <https://git.kernel.org/stable/c/6d42ddf7f27b6723549ee6d4c8b1b418b59bf6b5> (patch)

## Sources

- CVE List: [CVE-2022-50506](https://www.cve.org/CVERecord?id=CVE-2022-50506), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2022-50506](https://nvd.nist.gov/vuln/detail/CVE-2022-50506), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-50506 · Whole record: https://cve.day/CVE-2022-50506.json · Rebuilt by cve.day 2026-11-25T22:58:21.247Z
