CVE-2023-52897

In the Linux kernel, the following vulnerability has been resolved: btrfs: qgroup: do not warn on record without old_roots populated [BUG] There are some reports from the mailing list that since v6.1 kernel, the WARN_ON() inside btrfs_qgroup_account_extent() gets triggered during rescan: WARNING: CPU: 3 PID: 6424 at fs/btrfs/qgroup.c:2756 btrfs_qgroup_account_extents+0x1ae/0x260 [btrfs] CPU: 3 PID: 6424 Comm: snapperd Tainted: P OE 6.1.2-1-default #1 openSUSE Tumbleweed 05c7a1b1b61d5627475528f71f50444637b5aad7 RIP: 0010:btrfs_qgroup_account_extents+0x1ae/0x260 [btrfs] Call Trace: <TASK> btrfs_commit_transaction+0x30c/0xb40 [btrfs c39c9c546c241c593f03bd6d5f39ea1b676250f6] ? start_transaction+0xc3/0x5b0 [btrfs c39c9c546c241c593f03bd6d5f39ea1b676250f6] btrfs_qgroup_rescan+0x42/0xc0 [btrfs c39c9c546c241c593f03bd6d5f39ea1b676250f6] btrfs_ioctl+0x1ab9/0x25c0 [btrfs c39c9c546c241c593f03bd6d5f39ea1b676250f6] ? __rseq_handle_notify_resume+0xa9/0x4a0 ? mntput_no_expire+0x4a/0x240 ? __seccomp_filter+0x319/0x4d0 __x64_sys_ioctl+0x90/0xd0 do_syscall_64+0x5b/0x80 ? syscall_exit_to_user_mode+0x17/0x40 ? do_syscall_64+0x67/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fd9b790d9bf </TASK> [CAUSE] Since commit e15e9f43c7ca ("btrfs: introduce BTRFS_QGROUP_RUNTIME_FLAG_NO_ACCOUNTING to skip qgroup accounting"), if our qgroup is already in inconsistent state, we will no longer do the time-consuming backref walk. This can leave some qgroup records without a valid old_roots ulist. Normally this is fine, as btrfs_qgroup_account_extents() would also skip those records if we have NO_ACCOUNTING flag set. But there is a small window, if we have NO_ACCOUNTING flag set, and inserted some qgroup_record without a old_roots ulist, but then the user triggered a qgroup rescan. During btrfs_qgroup_rescan(), we firstly clear NO_ACCOUNTING flag, then commit current transaction. And since we have a qgroup_record with old_roots = NULL, we trigger the WARN_ON() during btrfs_qgroup_account_extents(). [FIX] Unfortunately due to the introduction of NO_ACCOUNTING flag, the assumption that every qgroup_record would have its old_roots populated is no longer correct. Fix the false alerts and drop the WARN_ON().
Configurations

Configuration 1 (hide)

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

History

13 Sep 2024, 13:52

Type Values Removed Values Added
First Time Linux linux Kernel
Linux
CWE NVD-CWE-noinfo
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 4.7
References () https://git.kernel.org/stable/c/75181406b4eafacc531ff2ee5fb032bd93317e2b - () https://git.kernel.org/stable/c/75181406b4eafacc531ff2ee5fb032bd93317e2b - Patch
References () https://git.kernel.org/stable/c/bb2c2e62539f2b63c5e0beb51501d328260c7595 - () https://git.kernel.org/stable/c/bb2c2e62539f2b63c5e0beb51501d328260c7595 - Patch
CPE cpe:2.3:o:linux:linux_kernel:6.2:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.2:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.2:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.2:rc3:*:*:*:*:*:*

21 Aug 2024, 12:30

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, se resolvió la siguiente vulnerabilidad: btrfs: qgroup: no advertir en el registro sin old_roots poblado [ERROR] Hay algunos informes de la lista de correo que desde el kernel v6.1, WARN_ON() dentro de btrfs_qgroup_account_extent() se activa durante la nueva exploración: ADVERTENCIA: CPU: 3 PID: 6424 en fs/btrfs/qgroup.c:2756 btrfs_qgroup_account_extents+0x1ae/0x260 [btrfs] CPU: 3 PID: 6424 Comm: snapperd Contaminado: P OE 6.1.2-1- predeterminado #1 openSUSE Tumbleweed 05c7a1b1b61d5627475528f71f50444637b5aad7 RIP: 0010:btrfs_qgroup_account_extents+0x1ae/0x260 [btrfs] Seguimiento de llamadas: btrfs_commit_transaction+0x30c/0xb40 c39c9c546c241c593f03bd6d5f39ea1b676250f6] ? start_transaction+0xc3/0x5b0 [btrfs c39c9c546c241c593f03bd6d5f39ea1b676250f6] btrfs_qgroup_rescan+0x42/0xc0 [btrfs c39c9c546c241c593f03bd6d5f39ea1b676250f 6]btrfs_ioctl+0x1ab9/0x25c0 [btrfs c39c9c546c241c593f03bd6d5f39ea1b676250f6]? __rseq_handle_notify_resume+0xa9/0x4a0 ? mntput_no_expire+0x4a/0x240? __seccomp_filter+0x319/0x4d0 __x64_sys_ioctl+0x90/0xd0 do_syscall_64+0x5b/0x80 ? syscall_exit_to_user_mode+0x17/0x40? do_syscall_64+0x67/0x80 Entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fd9b790d9bf [CAUSA] Desde el commit e15e9f43c7ca ("btrfs: introduzca BTRFS_QGROUP_RUNTIME_FLAG_NO_ACCOUNTING para omitir la contabilidad de qgroup"), si qgroup ya está en estado inconsistente, no lo haremos Ya no hagas la larga caminata hacia atrás. Esto puede dejar algunos registros de qgroup sin una lista old_roots válida. Normalmente, esto está bien, ya que btrfs_qgroup_account_extents() también omitiría esos registros si tenemos configurado el indicador NO_ACCOUNTING. Pero hay una pequeña ventana, si tenemos el indicador NO_ACCOUNTING configurado e insertamos algún qgroup_record sin una lista old_roots, pero luego el usuario activó una nueva exploración de qgroup. Durante btrfs_qgroup_rescan(), primero borramos el indicador NO_ACCOUNTING y luego confirmamos la transacción actual. Y como tenemos un qgroup_record con old_roots = NULL, activamos WARN_ON() durante btrfs_qgroup_account_extents(). [FIX] Desafortunadamente, debido a la introducción del indicador NO_ACCOUNTING, la suposición de que cada qgroup_record tendría sus old_roots completadas ya no es correcta. Corrija las alertas falsas y elimine WARN_ON().

21 Aug 2024, 07:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-08-21 07:15

Updated : 2024-09-13 13:52


NVD link : CVE-2023-52897

Mitre link : CVE-2023-52897

CVE.ORG link : CVE-2023-52897


JSON object : View

Products Affected

linux

  • linux_kernel