cve-2024-41067
Vulnerability from cvelistv5
Published
2024-07-29 14:57
Modified
2024-11-05 09:36
Severity ?
Summary
btrfs: scrub: handle RST lookup error correctly
Impacted products
Vendor Product Version
Linux Linux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T04:46:52.378Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/17d1fd302a53d7e456a7412da74be74a0cf63a72"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/2c49908634a2b97b1c3abe0589be2739ac5e7fd5"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-41067",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T16:21:49.560093Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:34:00.426Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/btrfs/scrub.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "17d1fd302a53",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "2c49908634a2",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/btrfs/scrub.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThanOrEqual": "6.9.*",
              "status": "unaffected",
              "version": "6.9.11",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.10",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: scrub: handle RST lookup error correctly\n\n[BUG]\nWhen running btrfs/060 with forced RST feature, it would crash the\nfollowing ASSERT() inside scrub_read_endio():\n\n\tASSERT(sector_nr \u003c stripe-\u003enr_sectors);\n\nBefore that, we would have tree dump from\nbtrfs_get_raid_extent_offset(), as we failed to find the RST entry for\nthe range.\n\n[CAUSE]\nInside scrub_submit_extent_sector_read() every time we allocated a new\nbbio we immediately called btrfs_map_block() to make sure there was some\nRST range covering the scrub target.\n\nBut if btrfs_map_block() fails, we immediately call endio for the bbio,\nwhile the bbio is newly allocated, it\u0027s completely empty.\n\nThen inside scrub_read_endio(), we go through the bvecs to find\nthe sector number (as bi_sector is no longer reliable if the bio is\nsubmitted to lower layers).\n\nAnd since the bio is empty, such bvecs iteration would not find any\nsector matching the sector, and return sector_nr == stripe-\u003enr_sectors,\ntriggering the ASSERT().\n\n[FIX]\nInstead of calling btrfs_map_block() after allocating a new bbio, call\nbtrfs_map_block() first.\n\nSince our only objective of calling btrfs_map_block() is only to update\nstripe_len, there is really no need to do that after btrfs_alloc_bio().\n\nThis new timing would avoid the problem of handling empty bbio\ncompletely, and in fact fixes a possible race window for the old code,\nwhere if the submission thread is the only owner of the pending_io, the\nscrub would never finish (since we didn\u0027t decrease the pending_io\ncounter).\n\nAlthough the root cause of RST lookup failure still needs to be\naddressed."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-11-05T09:36:05.089Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/17d1fd302a53d7e456a7412da74be74a0cf63a72"
        },
        {
          "url": "https://git.kernel.org/stable/c/2c49908634a2b97b1c3abe0589be2739ac5e7fd5"
        }
      ],
      "title": "btrfs: scrub: handle RST lookup error correctly",
      "x_generator": {
        "engine": "bippy-9e1c9544281a"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-41067",
    "datePublished": "2024-07-29T14:57:28.543Z",
    "dateReserved": "2024-07-12T12:17:45.630Z",
    "dateUpdated": "2024-11-05T09:36:05.089Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-41067\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-07-29T15:15:14.560\",\"lastModified\":\"2024-11-21T09:32:10.717\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbtrfs: scrub: handle RST lookup error correctly\\n\\n[BUG]\\nWhen running btrfs/060 with forced RST feature, it would crash the\\nfollowing ASSERT() inside scrub_read_endio():\\n\\n\\tASSERT(sector_nr \u003c stripe-\u003enr_sectors);\\n\\nBefore that, we would have tree dump from\\nbtrfs_get_raid_extent_offset(), as we failed to find the RST entry for\\nthe range.\\n\\n[CAUSE]\\nInside scrub_submit_extent_sector_read() every time we allocated a new\\nbbio we immediately called btrfs_map_block() to make sure there was some\\nRST range covering the scrub target.\\n\\nBut if btrfs_map_block() fails, we immediately call endio for the bbio,\\nwhile the bbio is newly allocated, it\u0027s completely empty.\\n\\nThen inside scrub_read_endio(), we go through the bvecs to find\\nthe sector number (as bi_sector is no longer reliable if the bio is\\nsubmitted to lower layers).\\n\\nAnd since the bio is empty, such bvecs iteration would not find any\\nsector matching the sector, and return sector_nr == stripe-\u003enr_sectors,\\ntriggering the ASSERT().\\n\\n[FIX]\\nInstead of calling btrfs_map_block() after allocating a new bbio, call\\nbtrfs_map_block() first.\\n\\nSince our only objective of calling btrfs_map_block() is only to update\\nstripe_len, there is really no need to do that after btrfs_alloc_bio().\\n\\nThis new timing would avoid the problem of handling empty bbio\\ncompletely, and in fact fixes a possible race window for the old code,\\nwhere if the submission thread is the only owner of the pending_io, the\\nscrub would never finish (since we didn\u0027t decrease the pending_io\\ncounter).\\n\\nAlthough the root cause of RST lookup failure still needs to be\\naddressed.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: btrfs: Scrub: maneja correctamente el error de b\u00fasqueda RST [ERROR] Al ejecutar btrfs/060 con la funci\u00f3n RST forzada, bloquear\u00eda el siguiente ASSERT() dentro de Scrub_read_endio(): ASSERT(sector_nr \u0026lt; raya-\u0026gt;nr_sectors); Antes de eso, tendr\u00edamos un volcado de \u00e1rbol de btrfs_get_raid_extent_offset(), ya que no pudimos encontrar la entrada RST para el rango. [CAUSA] Dentro de Scrub_submit_extent_sector_read() cada vez que asignamos un nuevo bbio llamamos inmediatamente a btrfs_map_block() para asegurarnos de que hubiera alg\u00fan rango RST que cubriera el objetivo de limpieza. Pero si btrfs_map_block()fallo, inmediatamente llamamos a endio para el bbio, mientras el bbio est\u00e1 reci\u00e9n asignado, est\u00e1 completamente vac\u00edo. Luego, dentro de Scrub_read_endio(), revisamos los bvecs para encontrar el n\u00famero del sector (ya que bi_sector ya no es confiable si la biograf\u00eda se env\u00eda a capas inferiores). Y dado que la biograf\u00eda est\u00e1 vac\u00eda, dicha iteraci\u00f3n de bvecs no encontrar\u00eda ning\u00fan sector que coincida con el sector y devolver\u00eda sector_nr == stripe-\u0026gt;nr_sectors, lo que activar\u00eda ASSERT(). [FIX] En lugar de llamar a btrfs_map_block() despu\u00e9s de asignar un nuevo bbio, llame primero a btrfs_map_block(). Dado que nuestro \u00fanico objetivo al llamar a btrfs_map_block() es solo actualizar stripe_len, realmente no hay necesidad de hacerlo despu\u00e9s de btrfs_alloc_bio(). Este nuevo tiempo evitar\u00eda por completo el problema de manejar bbio vac\u00edo y, de hecho, soluciona una posible ventana de ejecuci\u00f3npara el c\u00f3digo anterior, donde si el hilo de env\u00edo es el \u00fanico propietario de pendiente_io, la limpieza nunca terminar\u00eda (ya que no lo hicimos). disminuir el contador pendiente_io). Aunque a\u00fan es necesario abordar la causa ra\u00edz del error de b\u00fasqueda de RST.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/17d1fd302a53d7e456a7412da74be74a0cf63a72\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/2c49908634a2b97b1c3abe0589be2739ac5e7fd5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/17d1fd302a53d7e456a7412da74be74a0cf63a72\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/2c49908634a2b97b1c3abe0589be2739ac5e7fd5\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"}]}}"
  }
}


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.
  • 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.