CVE-2022-50752 (GCVE-0-2022-50752)
Vulnerability from cvelistv5
Published
2025-12-24 13:05
Modified
2025-12-24 13:05
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: md/raid5: Remove unnecessary bio_put() in raid5_read_one_chunk() When running chunk-sized reads on disks with badblocks duplicate bio free/puts are observed: ============================================================================= BUG bio-200 (Not tainted): Object already free ----------------------------------------------------------------------------- Allocated in mempool_alloc_slab+0x17/0x20 age=3 cpu=2 pid=7504 __slab_alloc.constprop.0+0x5a/0xb0 kmem_cache_alloc+0x31e/0x330 mempool_alloc_slab+0x17/0x20 mempool_alloc+0x100/0x2b0 bio_alloc_bioset+0x181/0x460 do_mpage_readpage+0x776/0xd00 mpage_readahead+0x166/0x320 blkdev_readahead+0x15/0x20 read_pages+0x13f/0x5f0 page_cache_ra_unbounded+0x18d/0x220 force_page_cache_ra+0x181/0x1c0 page_cache_sync_ra+0x65/0xb0 filemap_get_pages+0x1df/0xaf0 filemap_read+0x1e1/0x700 blkdev_read_iter+0x1e5/0x330 vfs_read+0x42a/0x570 Freed in mempool_free_slab+0x17/0x20 age=3 cpu=2 pid=7504 kmem_cache_free+0x46d/0x490 mempool_free_slab+0x17/0x20 mempool_free+0x66/0x190 bio_free+0x78/0x90 bio_put+0x100/0x1a0 raid5_make_request+0x2259/0x2450 md_handle_request+0x402/0x600 md_submit_bio+0xd9/0x120 __submit_bio+0x11f/0x1b0 submit_bio_noacct_nocheck+0x204/0x480 submit_bio_noacct+0x32e/0xc70 submit_bio+0x98/0x1a0 mpage_readahead+0x250/0x320 blkdev_readahead+0x15/0x20 read_pages+0x13f/0x5f0 page_cache_ra_unbounded+0x18d/0x220 Slab 0xffffea000481b600 objects=21 used=0 fp=0xffff8881206d8940 flags=0x17ffffc0010201(locked|slab|head|node=0|zone=2|lastcpupid=0x1fffff) CPU: 0 PID: 34525 Comm: kworker/u24:2 Not tainted 6.0.0-rc2-localyes-265166-gf11c5343fa3f #143 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Workqueue: raid5wq raid5_do_work Call Trace: <TASK> dump_stack_lvl+0x5a/0x78 dump_stack+0x10/0x16 print_trailer+0x158/0x165 object_err+0x35/0x50 free_debug_processing.cold+0xb7/0xbe __slab_free+0x1ae/0x330 kmem_cache_free+0x46d/0x490 mempool_free_slab+0x17/0x20 mempool_free+0x66/0x190 bio_free+0x78/0x90 bio_put+0x100/0x1a0 mpage_end_io+0x36/0x150 bio_endio+0x2fd/0x360 md_end_io_acct+0x7e/0x90 bio_endio+0x2fd/0x360 handle_failed_stripe+0x960/0xb80 handle_stripe+0x1348/0x3760 handle_active_stripes.constprop.0+0x72a/0xaf0 raid5_do_work+0x177/0x330 process_one_work+0x616/0xb20 worker_thread+0x2bd/0x6f0 kthread+0x179/0x1b0 ret_from_fork+0x22/0x30 </TASK> The double free is caused by an unnecessary bio_put() in the if(is_badblock(...)) error path in raid5_read_one_chunk(). The error path was moved ahead of bio_alloc_clone() in c82aa1b76787c ("md/raid5: move checking badblock before clone bio in raid5_read_one_chunk"). The previous code checked and freed align_bio which required a bio_put. After the move that is no longer needed as raid_bio is returned to the control of the common io path which performs its own endio resulting in a double free on bad device blocks.
Impacted products
Vendor Product Version
Linux Linux Version: c82aa1b76787c34fd02374e519b6f52cdeb2f54b
Version: c82aa1b76787c34fd02374e519b6f52cdeb2f54b
Version: c82aa1b76787c34fd02374e519b6f52cdeb2f54b
Version: c82aa1b76787c34fd02374e519b6f52cdeb2f54b
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/md/raid5.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "7a37c58ee72e1fadd22c4ee990cb74c2ca2280e7",
              "status": "affected",
              "version": "c82aa1b76787c34fd02374e519b6f52cdeb2f54b",
              "versionType": "git"
            },
            {
              "lessThan": "c0fd5d4d8fd7b1a50306d7a23c720cf808f41fdf",
              "status": "affected",
              "version": "c82aa1b76787c34fd02374e519b6f52cdeb2f54b",
              "versionType": "git"
            },
            {
              "lessThan": "21a9c7354aa59e97e26ece5f0a609c8bfa43020d",
              "status": "affected",
              "version": "c82aa1b76787c34fd02374e519b6f52cdeb2f54b",
              "versionType": "git"
            },
            {
              "lessThan": "c66a6f41e09ad386fd2cce22b9cded837bbbc704",
              "status": "affected",
              "version": "c82aa1b76787c34fd02374e519b6f52cdeb2f54b",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/md/raid5.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.14"
            },
            {
              "lessThan": "5.14",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.75",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.19.*",
              "status": "unaffected",
              "version": "5.19.17",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.0.*",
              "status": "unaffected",
              "version": "6.0.3",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.1",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.75",
                  "versionStartIncluding": "5.14",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.19.17",
                  "versionStartIncluding": "5.14",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.0.3",
                  "versionStartIncluding": "5.14",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1",
                  "versionStartIncluding": "5.14",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmd/raid5: Remove unnecessary bio_put() in raid5_read_one_chunk()\n\nWhen running chunk-sized reads on disks with badblocks duplicate bio\nfree/puts are observed:\n\n   =============================================================================\n   BUG bio-200 (Not tainted): Object already free\n   -----------------------------------------------------------------------------\n   Allocated in mempool_alloc_slab+0x17/0x20 age=3 cpu=2 pid=7504\n    __slab_alloc.constprop.0+0x5a/0xb0\n    kmem_cache_alloc+0x31e/0x330\n    mempool_alloc_slab+0x17/0x20\n    mempool_alloc+0x100/0x2b0\n    bio_alloc_bioset+0x181/0x460\n    do_mpage_readpage+0x776/0xd00\n    mpage_readahead+0x166/0x320\n    blkdev_readahead+0x15/0x20\n    read_pages+0x13f/0x5f0\n    page_cache_ra_unbounded+0x18d/0x220\n    force_page_cache_ra+0x181/0x1c0\n    page_cache_sync_ra+0x65/0xb0\n    filemap_get_pages+0x1df/0xaf0\n    filemap_read+0x1e1/0x700\n    blkdev_read_iter+0x1e5/0x330\n    vfs_read+0x42a/0x570\n   Freed in mempool_free_slab+0x17/0x20 age=3 cpu=2 pid=7504\n    kmem_cache_free+0x46d/0x490\n    mempool_free_slab+0x17/0x20\n    mempool_free+0x66/0x190\n    bio_free+0x78/0x90\n    bio_put+0x100/0x1a0\n    raid5_make_request+0x2259/0x2450\n    md_handle_request+0x402/0x600\n    md_submit_bio+0xd9/0x120\n    __submit_bio+0x11f/0x1b0\n    submit_bio_noacct_nocheck+0x204/0x480\n    submit_bio_noacct+0x32e/0xc70\n    submit_bio+0x98/0x1a0\n    mpage_readahead+0x250/0x320\n    blkdev_readahead+0x15/0x20\n    read_pages+0x13f/0x5f0\n    page_cache_ra_unbounded+0x18d/0x220\n   Slab 0xffffea000481b600 objects=21 used=0 fp=0xffff8881206d8940 flags=0x17ffffc0010201(locked|slab|head|node=0|zone=2|lastcpupid=0x1fffff)\n   CPU: 0 PID: 34525 Comm: kworker/u24:2 Not tainted 6.0.0-rc2-localyes-265166-gf11c5343fa3f #143\n   Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014\n   Workqueue: raid5wq raid5_do_work\n   Call Trace:\n    \u003cTASK\u003e\n    dump_stack_lvl+0x5a/0x78\n    dump_stack+0x10/0x16\n    print_trailer+0x158/0x165\n    object_err+0x35/0x50\n    free_debug_processing.cold+0xb7/0xbe\n    __slab_free+0x1ae/0x330\n    kmem_cache_free+0x46d/0x490\n    mempool_free_slab+0x17/0x20\n    mempool_free+0x66/0x190\n    bio_free+0x78/0x90\n    bio_put+0x100/0x1a0\n    mpage_end_io+0x36/0x150\n    bio_endio+0x2fd/0x360\n    md_end_io_acct+0x7e/0x90\n    bio_endio+0x2fd/0x360\n    handle_failed_stripe+0x960/0xb80\n    handle_stripe+0x1348/0x3760\n    handle_active_stripes.constprop.0+0x72a/0xaf0\n    raid5_do_work+0x177/0x330\n    process_one_work+0x616/0xb20\n    worker_thread+0x2bd/0x6f0\n    kthread+0x179/0x1b0\n    ret_from_fork+0x22/0x30\n    \u003c/TASK\u003e\n\nThe double free is caused by an unnecessary bio_put() in the\nif(is_badblock(...)) error path in raid5_read_one_chunk().\n\nThe error path was moved ahead of bio_alloc_clone() in c82aa1b76787c\n(\"md/raid5: move checking badblock before clone bio in\nraid5_read_one_chunk\"). The previous code checked and freed align_bio\nwhich required a bio_put. After the move that is no longer needed as\nraid_bio is returned to the control of the common io path which\nperforms its own endio resulting in a double free on bad device blocks."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-12-24T13:05:46.881Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/7a37c58ee72e1fadd22c4ee990cb74c2ca2280e7"
        },
        {
          "url": "https://git.kernel.org/stable/c/c0fd5d4d8fd7b1a50306d7a23c720cf808f41fdf"
        },
        {
          "url": "https://git.kernel.org/stable/c/21a9c7354aa59e97e26ece5f0a609c8bfa43020d"
        },
        {
          "url": "https://git.kernel.org/stable/c/c66a6f41e09ad386fd2cce22b9cded837bbbc704"
        }
      ],
      "title": "md/raid5: Remove unnecessary bio_put() in raid5_read_one_chunk()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-50752",
    "datePublished": "2025-12-24T13:05:46.881Z",
    "dateReserved": "2025-12-24T13:02:21.544Z",
    "dateUpdated": "2025-12-24T13:05:46.881Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-50752\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-12-24T13:16:01.930\",\"lastModified\":\"2025-12-24T13:16:01.930\",\"vulnStatus\":\"Received\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nmd/raid5: Remove unnecessary bio_put() in raid5_read_one_chunk()\\n\\nWhen running chunk-sized reads on disks with badblocks duplicate bio\\nfree/puts are observed:\\n\\n   =============================================================================\\n   BUG bio-200 (Not tainted): Object already free\\n   -----------------------------------------------------------------------------\\n   Allocated in mempool_alloc_slab+0x17/0x20 age=3 cpu=2 pid=7504\\n    __slab_alloc.constprop.0+0x5a/0xb0\\n    kmem_cache_alloc+0x31e/0x330\\n    mempool_alloc_slab+0x17/0x20\\n    mempool_alloc+0x100/0x2b0\\n    bio_alloc_bioset+0x181/0x460\\n    do_mpage_readpage+0x776/0xd00\\n    mpage_readahead+0x166/0x320\\n    blkdev_readahead+0x15/0x20\\n    read_pages+0x13f/0x5f0\\n    page_cache_ra_unbounded+0x18d/0x220\\n    force_page_cache_ra+0x181/0x1c0\\n    page_cache_sync_ra+0x65/0xb0\\n    filemap_get_pages+0x1df/0xaf0\\n    filemap_read+0x1e1/0x700\\n    blkdev_read_iter+0x1e5/0x330\\n    vfs_read+0x42a/0x570\\n   Freed in mempool_free_slab+0x17/0x20 age=3 cpu=2 pid=7504\\n    kmem_cache_free+0x46d/0x490\\n    mempool_free_slab+0x17/0x20\\n    mempool_free+0x66/0x190\\n    bio_free+0x78/0x90\\n    bio_put+0x100/0x1a0\\n    raid5_make_request+0x2259/0x2450\\n    md_handle_request+0x402/0x600\\n    md_submit_bio+0xd9/0x120\\n    __submit_bio+0x11f/0x1b0\\n    submit_bio_noacct_nocheck+0x204/0x480\\n    submit_bio_noacct+0x32e/0xc70\\n    submit_bio+0x98/0x1a0\\n    mpage_readahead+0x250/0x320\\n    blkdev_readahead+0x15/0x20\\n    read_pages+0x13f/0x5f0\\n    page_cache_ra_unbounded+0x18d/0x220\\n   Slab 0xffffea000481b600 objects=21 used=0 fp=0xffff8881206d8940 flags=0x17ffffc0010201(locked|slab|head|node=0|zone=2|lastcpupid=0x1fffff)\\n   CPU: 0 PID: 34525 Comm: kworker/u24:2 Not tainted 6.0.0-rc2-localyes-265166-gf11c5343fa3f #143\\n   Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014\\n   Workqueue: raid5wq raid5_do_work\\n   Call Trace:\\n    \u003cTASK\u003e\\n    dump_stack_lvl+0x5a/0x78\\n    dump_stack+0x10/0x16\\n    print_trailer+0x158/0x165\\n    object_err+0x35/0x50\\n    free_debug_processing.cold+0xb7/0xbe\\n    __slab_free+0x1ae/0x330\\n    kmem_cache_free+0x46d/0x490\\n    mempool_free_slab+0x17/0x20\\n    mempool_free+0x66/0x190\\n    bio_free+0x78/0x90\\n    bio_put+0x100/0x1a0\\n    mpage_end_io+0x36/0x150\\n    bio_endio+0x2fd/0x360\\n    md_end_io_acct+0x7e/0x90\\n    bio_endio+0x2fd/0x360\\n    handle_failed_stripe+0x960/0xb80\\n    handle_stripe+0x1348/0x3760\\n    handle_active_stripes.constprop.0+0x72a/0xaf0\\n    raid5_do_work+0x177/0x330\\n    process_one_work+0x616/0xb20\\n    worker_thread+0x2bd/0x6f0\\n    kthread+0x179/0x1b0\\n    ret_from_fork+0x22/0x30\\n    \u003c/TASK\u003e\\n\\nThe double free is caused by an unnecessary bio_put() in the\\nif(is_badblock(...)) error path in raid5_read_one_chunk().\\n\\nThe error path was moved ahead of bio_alloc_clone() in c82aa1b76787c\\n(\\\"md/raid5: move checking badblock before clone bio in\\nraid5_read_one_chunk\\\"). The previous code checked and freed align_bio\\nwhich required a bio_put. After the move that is no longer needed as\\nraid_bio is returned to the control of the common io path which\\nperforms its own endio resulting in a double free on bad device blocks.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/21a9c7354aa59e97e26ece5f0a609c8bfa43020d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/7a37c58ee72e1fadd22c4ee990cb74c2ca2280e7\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/c0fd5d4d8fd7b1a50306d7a23c720cf808f41fdf\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/c66a6f41e09ad386fd2cce22b9cded837bbbc704\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…