CVE-2022-50506

drbd: only clone bio if we have a backing device

State
Published
Severity
Not scored
Published
Oct 4, 2025
Updated
May 11, 2026
Reserved
Oct 4, 2025

Read the record on cve.org

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.

Scores

The record has no CVSS score.

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • c347a787e34cba0e5a80a04082dacaf259105605 to before 05580a3bbf3cec677cb00a85dfeb21d6a9b48eafAffected
  • c347a787e34cba0e5a80a04082dacaf259105605 to before 6d42ddf7f27b6723549ee6d4c8b1b418b59bf6b5Affected
LinuxLinux
  • 5.18Affected
  • before 5.18Not affected
  • 6.0.6 through 6.0.*Not affected
  • 6.1 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.