cve-2024-26727
Vulnerability from cvelistv5
Published
2024-04-03 14:55
Modified
2024-08-02 00:14
Severity
Summary
btrfs: do not ASSERT() if the newly created subvolume already got read
Impacted products
VendorProduct
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-26727",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-06-17T19:28:59.725318Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-17T19:29:08.159Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T00:14:12.984Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/3f5d47eb163bceb1b9e613c9003bae5fefc0046f"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/e31546b0f34af21738c4ceac47d662c00ee6382f"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/66b317a2fc45b2ef66527ee3f8fa08fb5beab88d"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/833775656d447c545133a744a0ed1e189ce61430"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/5a172344bfdabb46458e03708735d7b1a918c468"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/e03ee2fe873eb68c1f9ba5112fee70303ebf9dfb"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/btrfs/disk-io.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "3f5d47eb163b",
              "status": "affected",
              "version": "2dfb1e43f57d",
              "versionType": "git"
            },
            {
              "lessThan": "e31546b0f34a",
              "status": "affected",
              "version": "2dfb1e43f57d",
              "versionType": "git"
            },
            {
              "lessThan": "66b317a2fc45",
              "status": "affected",
              "version": "2dfb1e43f57d",
              "versionType": "git"
            },
            {
              "lessThan": "833775656d44",
              "status": "affected",
              "version": "2dfb1e43f57d",
              "versionType": "git"
            },
            {
              "lessThan": "5a172344bfda",
              "status": "affected",
              "version": "2dfb1e43f57d",
              "versionType": "git"
            },
            {
              "lessThan": "e03ee2fe873e",
              "status": "affected",
              "version": "2dfb1e43f57d",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/btrfs/disk-io.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.9"
            },
            {
              "lessThan": "5.9",
              "status": "unaffected",
              "version": "0",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.210",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.149",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.79",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.18",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.7.*",
              "status": "unaffected",
              "version": "6.7.6",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.8",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: do not ASSERT() if the newly created subvolume already got read\n\n[BUG]\nThere is a syzbot crash, triggered by the ASSERT() during subvolume\ncreation:\n\n assertion failed: !anon_dev, in fs/btrfs/disk-io.c:1319\n ------------[ cut here ]------------\n kernel BUG at fs/btrfs/disk-io.c:1319!\n invalid opcode: 0000 [#1] PREEMPT SMP KASAN\n RIP: 0010:btrfs_get_root_ref.part.0+0x9aa/0xa60\n  \u003cTASK\u003e\n  btrfs_get_new_fs_root+0xd3/0xf0\n  create_subvol+0xd02/0x1650\n  btrfs_mksubvol+0xe95/0x12b0\n  __btrfs_ioctl_snap_create+0x2f9/0x4f0\n  btrfs_ioctl_snap_create+0x16b/0x200\n  btrfs_ioctl+0x35f0/0x5cf0\n  __x64_sys_ioctl+0x19d/0x210\n  do_syscall_64+0x3f/0xe0\n  entry_SYSCALL_64_after_hwframe+0x63/0x6b\n ---[ end trace 0000000000000000 ]---\n\n[CAUSE]\nDuring create_subvol(), after inserting root item for the newly created\nsubvolume, we would trigger btrfs_get_new_fs_root() to get the\nbtrfs_root of that subvolume.\n\nThe idea here is, we have preallocated an anonymous device number for\nthe subvolume, thus we can assign it to the new subvolume.\n\nBut there is really nothing preventing things like backref walk to read\nthe new subvolume.\nIf that happens before we call btrfs_get_new_fs_root(), the subvolume\nwould be read out, with a new anonymous device number assigned already.\n\nIn that case, we would trigger ASSERT(), as we really expect no one to\nread out that subvolume (which is not yet accessible from the fs).\nBut things like backref walk is still possible to trigger the read on\nthe subvolume.\n\nThus our assumption on the ASSERT() is not correct in the first place.\n\n[FIX]\nFix it by removing the ASSERT(), and just free the @anon_dev, reset it\nto 0, and continue.\n\nIf the subvolume tree is read out by something else, it should have\nalready get a new anon_dev assigned thus we only need to free the\npreallocated one."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-05-29T05:21:38.099Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/3f5d47eb163bceb1b9e613c9003bae5fefc0046f"
        },
        {
          "url": "https://git.kernel.org/stable/c/e31546b0f34af21738c4ceac47d662c00ee6382f"
        },
        {
          "url": "https://git.kernel.org/stable/c/66b317a2fc45b2ef66527ee3f8fa08fb5beab88d"
        },
        {
          "url": "https://git.kernel.org/stable/c/833775656d447c545133a744a0ed1e189ce61430"
        },
        {
          "url": "https://git.kernel.org/stable/c/5a172344bfdabb46458e03708735d7b1a918c468"
        },
        {
          "url": "https://git.kernel.org/stable/c/e03ee2fe873eb68c1f9ba5112fee70303ebf9dfb"
        },
        {
          "url": "https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html"
        }
      ],
      "title": "btrfs: do not ASSERT() if the newly created subvolume already got read",
      "x_generator": {
        "engine": "bippy-a5840b7849dd"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-26727",
    "datePublished": "2024-04-03T14:55:25.805Z",
    "dateReserved": "2024-02-19T14:20:24.164Z",
    "dateUpdated": "2024-08-02T00:14:12.984Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-26727\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-04-03T15:15:54.367\",\"lastModified\":\"2024-06-25T21:15:58.400\",\"vulnStatus\":\"Awaiting Analysis\",\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbtrfs: do not ASSERT() if the newly created subvolume already got read\\n\\n[BUG]\\nThere is a syzbot crash, triggered by the ASSERT() during subvolume\\ncreation:\\n\\n assertion failed: !anon_dev, in fs/btrfs/disk-io.c:1319\\n ------------[ cut here ]------------\\n kernel BUG at fs/btrfs/disk-io.c:1319!\\n invalid opcode: 0000 [#1] PREEMPT SMP KASAN\\n RIP: 0010:btrfs_get_root_ref.part.0+0x9aa/0xa60\\n  \u003cTASK\u003e\\n  btrfs_get_new_fs_root+0xd3/0xf0\\n  create_subvol+0xd02/0x1650\\n  btrfs_mksubvol+0xe95/0x12b0\\n  __btrfs_ioctl_snap_create+0x2f9/0x4f0\\n  btrfs_ioctl_snap_create+0x16b/0x200\\n  btrfs_ioctl+0x35f0/0x5cf0\\n  __x64_sys_ioctl+0x19d/0x210\\n  do_syscall_64+0x3f/0xe0\\n  entry_SYSCALL_64_after_hwframe+0x63/0x6b\\n ---[ end trace 0000000000000000 ]---\\n\\n[CAUSE]\\nDuring create_subvol(), after inserting root item for the newly created\\nsubvolume, we would trigger btrfs_get_new_fs_root() to get the\\nbtrfs_root of that subvolume.\\n\\nThe idea here is, we have preallocated an anonymous device number for\\nthe subvolume, thus we can assign it to the new subvolume.\\n\\nBut there is really nothing preventing things like backref walk to read\\nthe new subvolume.\\nIf that happens before we call btrfs_get_new_fs_root(), the subvolume\\nwould be read out, with a new anonymous device number assigned already.\\n\\nIn that case, we would trigger ASSERT(), as we really expect no one to\\nread out that subvolume (which is not yet accessible from the fs).\\nBut things like backref walk is still possible to trigger the read on\\nthe subvolume.\\n\\nThus our assumption on the ASSERT() is not correct in the first place.\\n\\n[FIX]\\nFix it by removing the ASSERT(), and just free the @anon_dev, reset it\\nto 0, and continue.\\n\\nIf the subvolume tree is read out by something else, it should have\\nalready get a new anon_dev assigned thus we only need to free the\\npreallocated one.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se resolvi\u00f3 la siguiente vulnerabilidad: btrfs: no haga ASSERT() si el subvolumen reci\u00e9n creado ya se ley\u00f3 [ERROR] Hay un bloqueo del syzbot, provocado por ASSERT() durante la creaci\u00f3n del subvolumen: la aserci\u00f3n fall\u00f3: ! anon_dev, en fs/btrfs/disk-io.c:1319 ------------[ cortar aqu\u00ed ]------------ ERROR del kernel en fs/btrfs/disk -io.c:1319! c\u00f3digo de operaci\u00f3n no v\u00e1lido: 0000 [#1] PREEMPT SMP KASAN RIP: 0010:btrfs_get_root_ref.part.0+0x9aa/0xa60  btrfs_get_new_fs_root+0xd3/0xf0 create_subvol+0xd02/0x1650 btrfs_mksubvol+0xe95/0x12b0 __ btrfs_ioctl_snap_create+0x2f9/0x4f0 btrfs_ioctl_snap_create+0x16b /0x200 btrfs_ioctl+0x35f0/0x5cf0 __x64_sys_ioctl+0x19d/0x210 do_syscall_64+0x3f/0xe0 Entry_SYSCALL_64_after_hwframe+0x63/0x6b ---[ end trace 0000000000000000 ]--- [CA USO] Durante create_subvol(), despu\u00e9s de insertar el elemento ra\u00edz para el subvolumen reci\u00e9n creado , activar\u00edamos btrfs_get_new_fs_root() para obtener el btrfs_root de ese subvolumen. La idea aqu\u00ed es que hemos preasignado un n\u00famero de dispositivo an\u00f3nimo para el subvolumen, por lo que podemos asignarlo al nuevo subvolumen. Pero realmente no hay nada que impida que cosas como backref caminen para leer el nuevo subvolumen. Si eso sucede antes de que llamemos a btrfs_get_new_fs_root(), se leer\u00e1 el subvolumen y ya se habr\u00e1 asignado un nuevo n\u00famero de dispositivo an\u00f3nimo. En ese caso, activar\u00edamos ASSERT(), ya que realmente esperamos que nadie lea ese subvolumen (al que a\u00fan no se puede acceder desde fs). Pero a\u00fan es posible realizar cosas como el recorrido de referencia atr\u00e1s para activar la lectura en el subvolumen. Por lo tanto, nuestra suposici\u00f3n sobre ASSERT() no es correcta en primer lugar. [FIX] Arr\u00e9glelo eliminando ASSERT() y simplemente libere @anon_dev, restablezcalo a 0 y contin\u00fae. Si otra cosa lee el \u00e1rbol de subvolumen, ya deber\u00eda tener asignado un nuevo anon_dev, por lo que solo necesitamos liberar el preasignado.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/3f5d47eb163bceb1b9e613c9003bae5fefc0046f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/5a172344bfdabb46458e03708735d7b1a918c468\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/66b317a2fc45b2ef66527ee3f8fa08fb5beab88d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/833775656d447c545133a744a0ed1e189ce61430\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e03ee2fe873eb68c1f9ba5112fee70303ebf9dfb\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e31546b0f34af21738c4ceac47d662c00ee6382f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...