Instituto Nacional de ciberseguridad. Sección Incibe
Instituto Nacional de Ciberseguridad. Sección INCIBE-CERT

CVE-2025-39759

Gravedad:
Pendiente de análisis
Tipo:
No Disponible / Otro tipo
Fecha de publicación:
11/09/2025
Última modificación:
03/11/2025

Descripción

*** Pendiente de traducción *** In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> btrfs: qgroup: fix race between quota disable and quota rescan ioctl<br /> <br /> There&amp;#39;s a race between a task disabling quotas and another running the<br /> rescan ioctl that can result in a use-after-free of qgroup records from<br /> the fs_info-&gt;qgroup_tree rbtree.<br /> <br /> This happens as follows:<br /> <br /> 1) Task A enters btrfs_ioctl_quota_rescan() -&gt; btrfs_qgroup_rescan();<br /> <br /> 2) Task B enters btrfs_quota_disable() and calls<br /> btrfs_qgroup_wait_for_completion(), which does nothing because at that<br /> point fs_info-&gt;qgroup_rescan_running is false (it wasn&amp;#39;t set yet by<br /> task A);<br /> <br /> 3) Task B calls btrfs_free_qgroup_config() which starts freeing qgroups<br /> from fs_info-&gt;qgroup_tree without taking the lock fs_info-&gt;qgroup_lock;<br /> <br /> 4) Task A enters qgroup_rescan_zero_tracking() which starts iterating<br /> the fs_info-&gt;qgroup_tree tree while holding fs_info-&gt;qgroup_lock,<br /> but task B is freeing qgroup records from that tree without holding<br /> the lock, resulting in a use-after-free.<br /> <br /> Fix this by taking fs_info-&gt;qgroup_lock at btrfs_free_qgroup_config().<br /> Also at btrfs_qgroup_rescan() don&amp;#39;t start the rescan worker if quotas<br /> were already disabled.

Impacto