{"id":"CVE-2026-43187","aliases":["CVE-2026-43187"],"related":[],"kind":"vulnerability","state":"published","title":"xfs: delete attr leaf freemap entries when empty","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nxfs: delete attr leaf freemap entries when empty\n\nBack in commit 2a2b5932db6758 (\"xfs: fix attr leaf header freemap.size\nunderflow\"), Brian Foster observed that it's possible for a small\nfreemap at the end of the end of the xattr entries array to experience\na size underflow when subtracting the space consumed by an expansion of\nthe entries array.  There are only three freemap entries, which means\nthat it is not a complete index of all free space in the leaf block.\n\nThis code can leave behind a zero-length freemap entry with a nonzero\nbase.  Subsequent setxattr operations can increase the base up to the\npoint that it overlaps with another freemap entry.  This isn't in and of\nitself a problem because the code in _leaf_add that finds free space\nignores any freemap entry with zero size.\n\nHowever, there's another bug in the freemap update code in _leaf_add,\nwhich is that it fails to update a freemap entry that begins midway\nthrough the xattr entry that was just appended to the array.  That can\nresult in the freemap containing two entries with the same base but\ndifferent sizes (0 for the \"pushed-up\" entry, nonzero for the entry\nthat's actually tracking free space).  A subsequent _leaf_add can then\nallocate xattr namevalue entries on top of the entries array, leading to\ndata loss.  But fixing that is for later.\n\nFor now, eliminate the possibility of confusion by zeroing out the base\nof any freemap entry that has zero size.  Because the freemap is not\nintended to be a complete index of free space, a subsequent failure to\nfind any free space for a new xattr will trigger block compaction, which\nregenerates the freemap.\n\nIt looks like this bug has been in the codebase for quite a long time.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nxfs: delete attr leaf freemap entries when empty\n\nBack in commit 2a2b5932db6758 (\"xfs: fix attr leaf header freemap.size\nunderflow\"), Brian Foster observed that it's possible for a small\nfreemap at the end of the end of the xattr entries array to experience\na size underflow when subtracting the space consumed by an expansion of\nthe entries array.  There are only three freemap entries, which means\nthat it is not a complete index of all free space in the leaf block.\n\nThis code can leave behind a zero-length freemap entry with a nonzero\nbase.  Subsequent setxattr operations can increase the base up to the\npoint that it overlaps with another freemap entry.  This isn't in and of\nitself a problem because the code in _leaf_add that finds free space\nignores any freemap entry with zero size.\n\nHowever, there's another bug in the freemap update code in _leaf_add,\nwhich is that it fails to update a freemap entry that begins midway\nthrough the xattr entry that was just appended to the array.  That can\nresult in the freemap containing two entries with the same base but\ndifferent sizes (0 for the \"pushed-up\" entry, nonzero for the entry\nthat's actually tracking free space).  A subsequent _leaf_add can then\nallocate xattr namevalue entries on top of the entries array, leading to\ndata loss.  But fixing that is for later.\n\nFor now, eliminate the possibility of confusion by zeroing out the base\nof any freemap entry that has zero size.  Because the freemap is not\nintended to be a complete index of free space, a subsequent failure to\nfind any free space for a new xattr will trigger block compaction, which\nregenerates the freemap.\n\nIt looks like this bug has been in the codebase for quite a long time.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nxfs: eliminar entradas de freemap de hoja de atributo cuando están vacías\n\nEn el commit 2a2b5932db6758 (’xfs: corregir desbordamiento negativo de freemap.size en cabecera de hoja de atributo’), Brian Foster observó que es posible que un pequeño freemap al final del final del array de entradas xattr experimente un desbordamiento negativo de tamaño al restar el espacio consumido por una expansión del array de entradas. Solo hay tres entradas de freemap, lo que significa que no es un índice completo de todo el espacio libre en el bloque de hoja.\n\nEste código puede dejar atrás una entrada de freemap de longitud cero con una base distinta de cero. Operaciones setxattr posteriores pueden aumentar la base hasta el punto en que se superpone con otra entrada de freemap. Esto no es en sí mismo un problema porque el código en _leaf_add que encuentra espacio libre ignora cualquier entrada de freemap con tamaño cero.\n\nSin embargo, hay otro error en el código de actualización de freemap en _leaf_add, que es que no actualiza una entrada de freemap que comienza a mitad de la entrada xattr que acaba de ser añadida al array. Eso puede resultar en que el freemap contenga dos entradas con la misma base pero diferentes tamaños (0 para la entrada ’pushed-up’, distinto de cero para la entrada que realmente está rastreando el espacio libre). Un _leaf_add posterior puede entonces asignar entradas de nombre-valor xattr encima del array de entradas, lo que lleva a la pérdida de datos. Pero arreglar eso es para más tarde.\n\nPor ahora, elimine la posibilidad de confusión poniendo a cero la base de cualquier entrada de freemap que tenga tamaño cero. Debido a que el freemap no está destinado a ser un índice completo de espacio libre, un fallo posterior al encontrar cualquier espacio libre para un nuevo xattr activará la compactación de bloques, lo que regenera el freemap.\n\nParece que este error ha estado en la base de código durante bastante tiempo.","source":"nvd"}],"published":"2026-05-06T11:27:57.727Z","modified":"2026-11-11T20:10:00.273Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-190","CWE-191"],"affected":[{"ranges":[{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"f3c0d1fc1eadbb4adbee5ab7757d41d35f48325b","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"aa9083d97e2157da3c6fb45ddb1a97af7f188f7f","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"a631899025d47ea1aa6464d76db5b4d3b6d196fd","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"ffaf5c99d0f862db021fb1af8b813c1416b1beb2","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"e1b8c6452ee99a30e188a88f3f3f804fb1c6004a","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"f31a8334e1c54b126fcecf98645a49b6bc5ad399","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"479b05fc3ee272090f671b06a41f3da8aa78eece","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"6f13c1d2a6271c2e73226864a0e83de2770b6f34","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.12","status":"unaffected"},{"type":"semver","introduced":"5.10.252","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.202","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.165","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.128","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.75","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.16","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.6","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"2.6.12.1","fixed":"5.10.252"},{"status":"affected","introduced":"5.11","fixed":"5.15.202"},{"status":"affected","introduced":"5.16","fixed":"6.1.165"},{"status":"affected","introduced":"6.2","fixed":"6.6.128"},{"status":"affected","introduced":"6.7","fixed":"6.12.75"},{"status":"affected","introduced":"6.13","fixed":"6.18.16"},{"status":"affected","introduced":"6.19","fixed":"6.19.6"},{"status":"affected","version":"2.6.12"},{"status":"affected","version":"2.6.12"},{"status":"affected","version":"2.6.12"},{"status":"affected","version":"2.6.12"},{"status":"affected","version":"2.6.12"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/f3c0d1fc1eadbb4adbee5ab7757d41d35f48325b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/aa9083d97e2157da3c6fb45ddb1a97af7f188f7f","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a631899025d47ea1aa6464d76db5b4d3b6d196fd","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ffaf5c99d0f862db021fb1af8b813c1416b1beb2","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e1b8c6452ee99a30e188a88f3f3f804fb1c6004a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f31a8334e1c54b126fcecf98645a49b6bc5ad399","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/479b05fc3ee272090f671b06a41f3da8aa78eece","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6f13c1d2a6271c2e73226864a0e83de2770b6f34","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-16T15:15:27.998Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-43187","url":"https://www.cve.org/CVERecord?id=CVE-2026-43187","licence":"CVE Terms of Use","modified":"2026-10-19T19:16:23.230Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-43187","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43187","licence":"Public domain","modified":"2026-11-11T20:10:00.273Z"}],"updatedAt":"2026-11-25T22:59:20.719Z","epss":{"score":0.00469,"percentile":0.42203,"date":"2026-12-01T12:00:22.000Z"}}