Skip to content
Heist/ feed
Back to feed
UnratedFix available

drbd: only clone bio if we have a backing device

Type: advisorySources: OSV

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.

Products
Kernel
Affected versions
Not specified
Fixed versions
6.0.6
CVEs
CVE-2022-50506
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 02:01 UTC · Revision 1

Source evidence

drbd: only clone bio if we have a backing device

core-osv · Original source

Published 4 Oct 2025, 15:43 UTC

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.

osv:CVE-2022-50506

Kernel

Fixed versions: 6.0.6

Complete source record
{
  "id": "06fbcb8d04a973b097775c0b10c9d26571ab2c71228b1b43c75ab6e8e8edba16",
  "url": "https://osv.dev/vulnerability/CVE-2022-50506",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "drbd: only clone bio if we have a backing device",
    "summary": "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.",
    "evidence": "osv:CVE-2022-50506",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.0.6",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2022-50506",
      "aliases": [
        "CVE-2022-50506"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "c347a787e34cba0e5a80a04082dacaf259105605"
                },
                {
                  "fixed": "05580a3bbf3cec677cb00a85dfeb21d6a9b48eaf"
                },
                {
                  "fixed": "6d42ddf7f27b6723549ee6d4c8b1b418b59bf6b5"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50506.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.18.0"
                },
                {
                  "fixed": "6.0.6"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50506.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:41.885159280Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/05580a3bbf3cec677cb00a85dfeb21d6a9b48eaf",
        "https://git.kernel.org/stable/c/6d42ddf7f27b6723549ee6d4c8b1b418b59bf6b5",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50506.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-50506",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50506.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-50506",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 509309,
  "published_at": "2025-10-04T15:43:54.955+00:00"
}