CVE-2022-50506
5.5medium
drbd: only clone bio if we have a backing device
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.14% (higher than 3% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| 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 * | CVE List |
| linux linux_kernel | from 5.18 before 6.0.6, 6.1 | NVD |
Classification
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-50506 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2022-50506 changed 2026-06-17 | Public domain |