// For flags

CVE-2024-36027

btrfs: zoned: do not flag ZEROOUT on non-dirty extent buffer

Severity Score

"-"
*CVSS v-

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

Track
*SSVC
Descriptions

In the Linux kernel, the following vulnerability has been resolved:

btrfs: zoned: do not flag ZEROOUT on non-dirty extent buffer

Btrfs clears the content of an extent buffer marked as
EXTENT_BUFFER_ZONED_ZEROOUT before the bio submission. This mechanism is
introduced to prevent a write hole of an extent buffer, which is once
allocated, marked dirty, but turns out unnecessary and cleaned up within
one transaction operation.

Currently, btrfs_clear_buffer_dirty() marks the extent buffer as
EXTENT_BUFFER_ZONED_ZEROOUT, and skips the entry function. If this call
happens while the buffer is under IO (with the WRITEBACK flag set,
without the DIRTY flag), we can add the ZEROOUT flag and clear the
buffer's content just before a bio submission. As a result:

1) it can lead to adding faulty delayed reference item which leads to a
FS corrupted (EUCLEAN) error, and

2) it writes out cleared tree node on disk

The former issue is previously discussed in [1]. The corruption happens
when it runs a delayed reference update. So, on-disk data is safe.

[1] https://lore.kernel.org/linux-btrfs/3f4f2a0ff1a6c818050434288925bdcf3cd719e5.1709124777.git.naohiro.aota@wdc.com/

The latter one can reach on-disk data. But, as that node is already
processed by btrfs_clear_buffer_dirty(), that will be invalidated in the
next transaction commit anyway. So, the chance of hitting the corruption
is relatively small.

Anyway, we should skip flagging ZEROOUT on a non-DIRTY extent buffer, to
keep the content under IO intact.

En el kernel de Linux, se resolvió la siguiente vulnerabilidad: btrfs: zonado: no marcar ZEROOUT en el búfer de extensión no sucio Btrfs borra el contenido de un búfer de extensión marcado como EXTENT_BUFFER_ZONED_ZEROOUT antes del envío de la biografía. Este mecanismo se introduce para evitar un agujero de escritura en un búfer de extensión, que una vez asignado, se marca como sucio, pero resulta innecesario y se limpia dentro de una operación de transacción. Actualmente, btrfs_clear_buffer_dirty() marca el búfer de extensión como EXTENT_BUFFER_ZONED_ZEROOUT y omite la función de entrada. Si esta llamada ocurre mientras el búfer está bajo IO (con el indicador WRITEBACK configurado, sin el indicador DIRTY), podemos agregar el indicador ZEROOUT y borrar el contenido del búfer justo antes de enviar una biografía. Como resultado: 1) puede provocar que se agregue un elemento de referencia retrasado defectuoso, lo que provoca un error de FS dañado (EUCLEAN), y 2) escribe el nodo del árbol borrado en el disco. El primer problema se analizó anteriormente en [1]. La corrupción ocurre cuando ejecuta una actualización de referencia retrasada. Por lo tanto, los datos en el disco están seguros. [1] https://lore.kernel.org/linux-btrfs/3f4f2a0ff1a6c818050434288925bdcf3cd719e5.1709124777.git.naohiro.aota@wdc.com/ Este último puede acceder a datos en disco. Pero, como ese nodo ya está procesado por btrfs_clear_buffer_dirty(), de todos modos se invalidará en la próxima confirmación de transacción. Por lo tanto, la posibilidad de combatir la corrupción es relativamente pequeña. De todos modos, debemos omitir marcar ZEROOUT en un búfer de extensión que no sea DIRTY, para mantener intacto el contenido bajo IO.

*Credits: N/A
CVSS Scores
Attack Vector
-
Attack Complexity
-
Privileges Required
-
User Interaction
-
Scope
-
Confidentiality
-
Integrity
-
Availability
-
* Common Vulnerability Scoring System
SSVC
  • Decision:Track
Exploitation
None
Automatable
No
Tech. Impact
Partial
* Organization's Worst-case Scenario
Timeline
  • 2024-05-17 CVE Reserved
  • 2024-05-30 CVE Published
  • 2024-05-31 EPSS Updated
  • 2024-08-02 CVE Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 6.8 < 6.8.8
Search vendor "Linux" for product "Linux Kernel" and version " >= 6.8 < 6.8.8"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 6.8 < 6.9
Search vendor "Linux" for product "Linux Kernel" and version " >= 6.8 < 6.9"
en
Affected