CVE-2026-43118

In the Linux kernel, the following vulnerability has been resolved: btrfs: fix zero size inode with non-zero size after log replay When logging that an inode exists, as part of logging a new name or logging new dir entries for a directory, we always set the generation of the logged inode item to 0. This is to signal during log replay (in overwrite_item()), that we should not set the i_size since we only logged that an inode exists, so the i_size of the inode in the subvolume tree must be preserved (as when we log new names or that an inode exists, we don't log extents). This works fine except when we have already logged an inode in full mode or it's the first time we are logging an inode created in a past transaction, that inode has a new i_size of 0 and then we log a new name for the inode (due to a new hardlink or a rename), in which case we log an i_size of 0 for the inode and a generation of 0, which causes the log replay code to not update the inode's i_size to 0 (in overwrite_item()). An example scenario: mkdir /mnt/dir xfs_io -f -c "pwrite 0 64K" /mnt/dir/foo sync xfs_io -c "truncate 0" -c "fsync" /mnt/dir/foo ln /mnt/dir/foo /mnt/dir/bar xfs_io -c "fsync" /mnt/dir <power fail> After log replay the file remains with a size of 64K. This is because when we first log the inode, when we fsync file foo, we log its current i_size of 0, and then when we create a hard link we log again the inode in exists mode (LOG_INODE_EXISTS) but we set a generation of 0 for the inode item we add to the log tree, so during log replay overwrite_item() sees that the generation is 0 and i_size is 0 so we skip updating the inode's i_size from 64K to 0. Fix this by making sure at fill_inode_item() we always log the real generation of the inode if it was logged in the current transaction with the i_size we logged before. Also if an inode created in a previous transaction is logged in exists mode only, make sure we log the i_size stored in the inode item located from the commit root, so that if we log multiple times that the inode exists we get the correct i_size. A test case for fstests will follow soon.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:*

History

11 Nov 2026, 21:10

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: btrfs: corrige inode de tamaño cero con tamaño no cero después de la reproducción del registro Al registrar que un inode existe, como parte de registrar un nuevo nombre o registrar nuevas entradas de directorio para un directorio, siempre establecemos la generación del elemento inode registrado en 0. Esto es para señalar durante la reproducción del registro (en overwrite_item()), que no debemos establecer el i_size ya que solo registramos que un inode existe, por lo que el i_size del inode en el árbol del subvolumen debe preservarse (ya que cuando registramos nuevos nombres o que un inode existe, no registramos extensiones). Esto funciona bien excepto cuando ya hemos registrado un inode en modo completo o es la primera vez que registramos un inode creado en una transacción pasada, ese inode tiene un nuevo i_size de 0 y luego registramos un nuevo nombre para el inode (debido a un nuevo enlace duro o un cambio de nombre), en cuyo caso registramos un i_size de 0 para el inode y una generación de 0, lo que hace que el código de reproducción del registro no actualice el i_size del inode a 0 (en overwrite_item()). Un escenario de ejemplo: mkdir /mnt/dir xfs_io -f -c ’pwrite 0 64K’ /mnt/dir/foo sync xfs_io -c ’truncate 0’ -c ’fsync’ /mnt/dir/foo ln /mnt/dir/foo /mnt/dir/bar xfs_io -c ’fsync’ /mnt/dir <falla de energía> Después de la reproducción del registro, el archivo permanece con un tamaño de 64K. Esto se debe a que cuando registramos el inode por primera vez, al hacer fsync del archivo foo, registramos su i_size actual de 0, y luego, cuando creamos un enlace duro, volvemos a registrar el inode en modo de existencia (LOG_INODE_EXISTS) pero establecemos una generación de 0 para el elemento inode que agregamos al árbol de registro, por lo que durante la reproducción del registro overwrite_item() ve que la generación es 0 y el i_size es 0, por lo que omitimos actualizar el i_size del inode de 64K a 0. Esto se corrige asegurándonos de que en fill_inode_item() siempre registramos la generación real del inode si fue registrado en la transacción actual con el i_size que registramos antes. Además, si un inode creado en una transacción anterior se registra solo en modo de existencia, nos aseguramos de registrar el i_size almacenado en el elemento inode ubicado desde la raíz de commit, de modo que si registramos varias veces que el inode existe, obtenemos el i_size correcto. Pronto seguirá un caso de prueba para fstests.

30 Oct 2026, 13:18

Type Values Removed Values Added
References
  • () https://git.kernel.org/stable/c/126999610eddeb1de3b47680585f4bc9531dc7f4 -

21 Oct 2026, 13:18

Type Values Removed Values Added
References
  • () https://git.kernel.org/stable/c/91990732ec4ce5c09361d498c6d621f5a76ee1f2 -
  • () https://git.kernel.org/stable/c/c939bfa67d221f75351a5bf2fc912e8125547b7e -

Information

Published : 2026-05-06 10:16

Updated : 2026-11-11 21:10


NVD link : CVE-2026-43118

Mitre link : CVE-2026-43118

CVE.ORG link : CVE-2026-43118


JSON object : View

Products Affected

linux

  • linux_kernel