cve-2022-48901
Vulnerability from cvelistv5
Published
2024-08-22 01:30
Modified
2024-12-19 08:10
Severity ?
EPSS score ?
Summary
btrfs: do not start relocation until in progress drops are done
References
{ "containers": { "adp": [ { "metrics": [ { "other": { "content": { "id": "CVE-2022-48901", "options": [ { "Exploitation": "none" }, { "Automatable": "no" }, { "Technical Impact": "partial" } ], "role": "CISA Coordinator", "timestamp": "2024-09-10T15:34:33.459779Z", "version": "2.0.3" }, "type": "ssvc" } } ], "providerMetadata": { "dateUpdated": "2024-09-12T17:33:02.805Z", "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "shortName": "CISA-ADP" }, "title": "CISA ADP Vulnrichment" } ], "cna": { "affected": [ { "defaultStatus": "unaffected", "product": "Linux", "programFiles": [ "fs/btrfs/ctree.h", "fs/btrfs/disk-io.c", "fs/btrfs/extent-tree.c", "fs/btrfs/relocation.c", "fs/btrfs/root-tree.c", "fs/btrfs/transaction.c", "fs/btrfs/transaction.h" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "lessThan": "6599d5e8bd758d897fd2ef4dc388ae50278b1f7e", "status": "affected", "version": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2", "versionType": "git" }, { "lessThan": "5e70bc827b563caf22e1203428cc3719643de5aa", "status": "affected", "version": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2", "versionType": "git" }, { "lessThan": "b4be6aefa73c9a6899ef3ba9c5faaa8a66e333ef", "status": "affected", "version": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2", "versionType": "git" } ] }, { "defaultStatus": "affected", "product": "Linux", "programFiles": [ "fs/btrfs/ctree.h", "fs/btrfs/disk-io.c", "fs/btrfs/extent-tree.c", "fs/btrfs/relocation.c", "fs/btrfs/root-tree.c", "fs/btrfs/transaction.c", "fs/btrfs/transaction.h" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "lessThanOrEqual": "5.15.*", "status": "unaffected", "version": "5.15.27", "versionType": "semver" }, { "lessThanOrEqual": "5.16.*", "status": "unaffected", "version": "5.16.13", "versionType": "semver" }, { "lessThanOrEqual": "*", "status": "unaffected", "version": "5.17", "versionType": "original_commit_for_fix" } ] } ], "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: do not start relocation until in progress drops are done\n\nWe hit a bug with a recovering relocation on mount for one of our file\nsystems in production. I reproduced this locally by injecting errors\ninto snapshot delete with balance running at the same time. This\npresented as an error while looking up an extent item\n\n WARNING: CPU: 5 PID: 1501 at fs/btrfs/extent-tree.c:866 lookup_inline_extent_backref+0x647/0x680\n CPU: 5 PID: 1501 Comm: btrfs-balance Not tainted 5.16.0-rc8+ #8\n RIP: 0010:lookup_inline_extent_backref+0x647/0x680\n RSP: 0018:ffffae0a023ab960 EFLAGS: 00010202\n RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000000\n RDX: 0000000000000000 RSI: 000000000000000c RDI: 0000000000000000\n RBP: ffff943fd2a39b60 R08: 0000000000000000 R09: 0000000000000001\n R10: 0001434088152de0 R11: 0000000000000000 R12: 0000000001d05000\n R13: ffff943fd2a39b60 R14: ffff943fdb96f2a0 R15: ffff9442fc923000\n FS: 0000000000000000(0000) GS:ffff944e9eb40000(0000) knlGS:0000000000000000\n CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033\n CR2: 00007f1157b1fca8 CR3: 000000010f092000 CR4: 0000000000350ee0\n Call Trace:\n \u003cTASK\u003e\n insert_inline_extent_backref+0x46/0xd0\n __btrfs_inc_extent_ref.isra.0+0x5f/0x200\n ? btrfs_merge_delayed_refs+0x164/0x190\n __btrfs_run_delayed_refs+0x561/0xfa0\n ? btrfs_search_slot+0x7b4/0xb30\n ? btrfs_update_root+0x1a9/0x2c0\n btrfs_run_delayed_refs+0x73/0x1f0\n ? btrfs_update_root+0x1a9/0x2c0\n btrfs_commit_transaction+0x50/0xa50\n ? btrfs_update_reloc_root+0x122/0x220\n prepare_to_merge+0x29f/0x320\n relocate_block_group+0x2b8/0x550\n btrfs_relocate_block_group+0x1a6/0x350\n btrfs_relocate_chunk+0x27/0xe0\n btrfs_balance+0x777/0xe60\n balance_kthread+0x35/0x50\n ? btrfs_balance+0xe60/0xe60\n kthread+0x16b/0x190\n ? set_kthread_struct+0x40/0x40\n ret_from_fork+0x22/0x30\n \u003c/TASK\u003e\n\nNormally snapshot deletion and relocation are excluded from running at\nthe same time by the fs_info-\u003ecleaner_mutex. However if we had a\npending balance waiting to get the -\u003ecleaner_mutex, and a snapshot\ndeletion was running, and then the box crashed, we would come up in a\nstate where we have a half deleted snapshot.\n\nAgain, in the normal case the snapshot deletion needs to complete before\nrelocation can start, but in this case relocation could very well start\nbefore the snapshot deletion completes, as we simply add the root to the\ndead roots list and wait for the next time the cleaner runs to clean up\nthe snapshot.\n\nFix this by setting a bit on the fs_info if we have any DEAD_ROOT\u0027s that\nhad a pending drop_progress key. If they do then we know we were in the\nmiddle of the drop operation and set a flag on the fs_info. Then\nbalance can wait until this flag is cleared to start up again.\n\nIf there are DEAD_ROOT\u0027s that don\u0027t have a drop_progress set then we\u0027re\nsafe to start balance right away as we\u0027ll be properly protected by the\ncleaner_mutex." } ], "providerMetadata": { "dateUpdated": "2024-12-19T08:10:08.959Z", "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux" }, "references": [ { "url": "https://git.kernel.org/stable/c/6599d5e8bd758d897fd2ef4dc388ae50278b1f7e" }, { "url": "https://git.kernel.org/stable/c/5e70bc827b563caf22e1203428cc3719643de5aa" }, { "url": "https://git.kernel.org/stable/c/b4be6aefa73c9a6899ef3ba9c5faaa8a66e333ef" } ], "title": "btrfs: do not start relocation until in progress drops are done", "x_generator": { "engine": "bippy-5f407fcff5a0" } } }, "cveMetadata": { "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "assignerShortName": "Linux", "cveId": "CVE-2022-48901", "datePublished": "2024-08-22T01:30:15.942Z", "dateReserved": "2024-08-21T06:06:23.291Z", "dateUpdated": "2024-12-19T08:10:08.959Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1", "meta": { "nvd": "{\"cve\":{\"id\":\"CVE-2022-48901\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-08-22T02:15:04.733\",\"lastModified\":\"2024-09-12T14:05:35.127\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbtrfs: do not start relocation until in progress drops are done\\n\\nWe hit a bug with a recovering relocation on mount for one of our file\\nsystems in production. I reproduced this locally by injecting errors\\ninto snapshot delete with balance running at the same time. This\\npresented as an error while looking up an extent item\\n\\n WARNING: CPU: 5 PID: 1501 at fs/btrfs/extent-tree.c:866 lookup_inline_extent_backref+0x647/0x680\\n CPU: 5 PID: 1501 Comm: btrfs-balance Not tainted 5.16.0-rc8+ #8\\n RIP: 0010:lookup_inline_extent_backref+0x647/0x680\\n RSP: 0018:ffffae0a023ab960 EFLAGS: 00010202\\n RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000000\\n RDX: 0000000000000000 RSI: 000000000000000c RDI: 0000000000000000\\n RBP: ffff943fd2a39b60 R08: 0000000000000000 R09: 0000000000000001\\n R10: 0001434088152de0 R11: 0000000000000000 R12: 0000000001d05000\\n R13: ffff943fd2a39b60 R14: ffff943fdb96f2a0 R15: ffff9442fc923000\\n FS: 0000000000000000(0000) GS:ffff944e9eb40000(0000) knlGS:0000000000000000\\n CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033\\n CR2: 00007f1157b1fca8 CR3: 000000010f092000 CR4: 0000000000350ee0\\n Call Trace:\\n \u003cTASK\u003e\\n insert_inline_extent_backref+0x46/0xd0\\n __btrfs_inc_extent_ref.isra.0+0x5f/0x200\\n ? btrfs_merge_delayed_refs+0x164/0x190\\n __btrfs_run_delayed_refs+0x561/0xfa0\\n ? btrfs_search_slot+0x7b4/0xb30\\n ? btrfs_update_root+0x1a9/0x2c0\\n btrfs_run_delayed_refs+0x73/0x1f0\\n ? btrfs_update_root+0x1a9/0x2c0\\n btrfs_commit_transaction+0x50/0xa50\\n ? btrfs_update_reloc_root+0x122/0x220\\n prepare_to_merge+0x29f/0x320\\n relocate_block_group+0x2b8/0x550\\n btrfs_relocate_block_group+0x1a6/0x350\\n btrfs_relocate_chunk+0x27/0xe0\\n btrfs_balance+0x777/0xe60\\n balance_kthread+0x35/0x50\\n ? btrfs_balance+0xe60/0xe60\\n kthread+0x16b/0x190\\n ? set_kthread_struct+0x40/0x40\\n ret_from_fork+0x22/0x30\\n \u003c/TASK\u003e\\n\\nNormally snapshot deletion and relocation are excluded from running at\\nthe same time by the fs_info-\u003ecleaner_mutex. However if we had a\\npending balance waiting to get the -\u003ecleaner_mutex, and a snapshot\\ndeletion was running, and then the box crashed, we would come up in a\\nstate where we have a half deleted snapshot.\\n\\nAgain, in the normal case the snapshot deletion needs to complete before\\nrelocation can start, but in this case relocation could very well start\\nbefore the snapshot deletion completes, as we simply add the root to the\\ndead roots list and wait for the next time the cleaner runs to clean up\\nthe snapshot.\\n\\nFix this by setting a bit on the fs_info if we have any DEAD_ROOT\u0027s that\\nhad a pending drop_progress key. If they do then we know we were in the\\nmiddle of the drop operation and set a flag on the fs_info. Then\\nbalance can wait until this flag is cleared to start up again.\\n\\nIf there are DEAD_ROOT\u0027s that don\u0027t have a drop_progress set then we\u0027re\\nsafe to start balance right away as we\u0027ll be properly protected by the\\ncleaner_mutex.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se resolvi\u00f3 la siguiente vulnerabilidad: btrfs: no inicie la reubicaci\u00f3n hasta que se completen las ca\u00eddas en progreso. Nos topamos con un error con una reubicaci\u00f3n de recuperaci\u00f3n en el montaje para uno de nuestros sistemas de archivos en producci\u00f3n. Reproduje esto localmente inyectando errores en la eliminaci\u00f3n de instant\u00e1neas con el saldo ejecut\u00e1ndose al mismo tiempo. Esto se present\u00f3 como un error al buscar un elemento de extensi\u00f3n ADVERTENCIA: CPU: 5 PID: 1501 en fs/btrfs/extent-tree.c:866 lookup_inline_extent_backref+0x647/0x680 CPU: 5 PID: 1501 Comm: btrfs-balance No contaminado 5.16 .0-rc8+ #8 RIP: 0010:lookup_inline_extent_backref+0x647/0x680 RSP: 0018:ffffae0a023ab960 EFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 000000000000000 RDX: 0000000000000000 RSI: 000000000000000c RDI: 0000000000000000 RBP: ffff943fd2a39b60 R08: 0000000000000000 R09: 000000000001 R10: 0001434088152de0 R11: 0000000000000000 R12: 0000000001d05000 R13: ffff943fd2a39b60 R14: ffff943fdb96f2a0 R15: ffff9442fc923000 FS: 000000000000000(0000) GS:ffff944e9eb40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 3: 000000010f092000 CR4: 0000000000350ee0 Seguimiento de llamadas: insert_inline_extent_backref+0x46/0xd0 __btrfs_inc_extent_ref.isra.0+0x5f/0x200 ? btrfs_merge_delayed_refs+0x164/0x190 __btrfs_run_delayed_refs+0x561/0xfa0 ? btrfs_search_slot+0x7b4/0xb30? btrfs_update_root+0x1a9/0x2c0 btrfs_run_delayed_refs+0x73/0x1f0 ? btrfs_update_root+0x1a9/0x2c0 btrfs_commit_transaction+0x50/0xa50 ? btrfs_update_reloc_root+0x122/0x220 prepare_to_merge+0x29f/0x320 relocate_block_group+0x2b8/0x550 btrfs_relocate_block_group+0x1a6/0x350 btrfs_relocate_chunk+0x27/0xe0 btrfs_balance+0x777/0xe60 balance_kthread+0x35/0x50? btrfs_balance+0xe60/0xe60 kthread+0x16b/0x190 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 Normalmente, fs_info-\u0026gt;cleaner_mutex excluye la ejecuci\u00f3n simult\u00e1nea de la eliminaci\u00f3n y reubicaci\u00f3n de instant\u00e1neas. Sin embargo, si tuvi\u00e9ramos un saldo pendiente esperando obtener -\u0026gt;cleaner_mutex, y se estuviera ejecutando una eliminaci\u00f3n de instant\u00e1nea y luego el cuadro fallara, llegar\u00edamos a un estado en el que tendr\u00edamos una instant\u00e1nea medio eliminada. Nuevamente, en el caso normal, la eliminaci\u00f3n de la instant\u00e1nea debe completarse antes de que pueda comenzar la reubicaci\u00f3n, pero en este caso la reubicaci\u00f3n podr\u00eda muy bien comenzar antes de que se complete la eliminaci\u00f3n de la instant\u00e1nea, ya que simplemente agregamos la ra\u00edz a la lista de ra\u00edces muertas y esperamos la pr\u00f3xima vez que se complete la eliminaci\u00f3n de la instant\u00e1nea. El limpiador se ejecuta para limpiar la instant\u00e1nea. Solucione este problema configurando un bit en fs_info si tenemos alg\u00fan DEAD_ROOT que tenga una clave drop_progress pendiente. Si lo hacen, entonces sabremos que est\u00e1bamos en medio de la operaci\u00f3n de colocaci\u00f3n y configuramos una bandera en fs_info. Luego, el saldo puede esperar hasta que se borre esta bandera para comenzar nuevamente. Si hay DEAD_ROOT que no tienen drop_progress configurado, entonces podemos comenzar a equilibrar de inmediato, ya que estaremos protegidos adecuadamente por clean_mutex.\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"NVD-CWE-noinfo\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionEndExcluding\":\"5.15.27\",\"matchCriteriaId\":\"A48510A0-1C49-4D24-BB6E-AC9B5F1C4DFD\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.16\",\"versionEndExcluding\":\"5.16.13\",\"matchCriteriaId\":\"B871B667-EDC0-435D-909E-E918D8D90995\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.17:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"7BD5F8D9-54FA-4CB0-B4F0-CB0471FDDB2D\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.17:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"E6E34B23-78B4-4516-9BD8-61B33F4AC49A\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.17:rc3:*:*:*:*:*:*\",\"matchCriteriaId\":\"C030FA3D-03F4-4FB9-9DBF-D08E5CAC51AA\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.17:rc4:*:*:*:*:*:*\",\"matchCriteriaId\":\"B2D2677C-5389-4AE9-869D-0F881E80D923\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.17:rc5:*:*:*:*:*:*\",\"matchCriteriaId\":\"EFA3917C-C322-4D92-912D-ECE45B2E7416\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.17:rc6:*:*:*:*:*:*\",\"matchCriteriaId\":\"BED18363-5ABC-4639-8BBA-68E771E5BB3F\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/5e70bc827b563caf22e1203428cc3719643de5aa\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/6599d5e8bd758d897fd2ef4dc388ae50278b1f7e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/b4be6aefa73c9a6899ef3ba9c5faaa8a66e333ef\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}" } }
Loading...
Loading...
- 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.