Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11137280CD5 for ; Wed, 24 Dec 2025 13:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766581627; cv=none; b=maL6dC6hjopYn6BnjPxpx0AnCD9MPSV5bEvUOStFL1GOjGGYedpqK406qJE+IK1JFiyIQgWwueWNwgA5HF0kqrPTpZp4gLwwssVccm+3t4uY+6+kJIeUUjaq+caoPMGPtQzmcpDuVxxXIhaCeuj+MMGEeWh/uZX69Z6ymacDB0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766581627; c=relaxed/simple; bh=RskI7eKkT+B1LKAi7m5T8TBNll9S09Ojp82njCB0AhI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gEqDyv87PKLWAUH8YwNJizO2m2h7p762l2D8bM6dXKTchiriBIgkEDV41lMuD4ebvZx4DbnIdd1aUAepLZOz5FarGSVpUA098NMBVsJOdpOIiMDU0Iu32mXg2eL1+7jh3v1G5hWxN4nOkvtVoq5TzsXnD4x6qUP97cl+AuzJC+4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AAP3B45z; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AAP3B45z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 427FCC4CEFB; Wed, 24 Dec 2025 13:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1766581626; bh=RskI7eKkT+B1LKAi7m5T8TBNll9S09Ojp82njCB0AhI=; h=From:To:Cc:Subject:Date:Reply-To:From; b=AAP3B45z/CU3ru84mAwQtLCtblJ8iV9AjU/86VNaWl9E2xDaSW2S6ZDjSjIXI781R UtHizVaP1AEzVzLwG0tvRctTXaLXNp6Fe7+yr9RaDTau/3KB7IqsGCg7lcPHWM0b7j AjAbERY6/E53adUK0LPNq3jDrhKMGavYCJCambGM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50755: udf: Avoid double brelse() in udf_rename() Date: Wed, 24 Dec 2025 14:06:06 +0100 Message-ID: <2025122453-CVE-2022-50755-f5d8@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4055; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=m/CxFZLuEVKceZZTFV//Ko+Ssq/G9Hv94UafsSo5hi0=; b=owGbwMvMwCRo6H6F97bub03G02pJDJneTw1rP16IvuT/dN/OSO3b89zvvX71d/G5DsUvWYqOC zbmr1JK64hlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJiKgxzGRMtT9yKSlxQnF/ roX9n4a3N7893cgwP0vg9a09kuYq5w7np/SIRv7L+p8hDQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: udf: Avoid double brelse() in udf_rename() syzbot reported a warning like below [1]: VFS: brelse: Trying to free free buffer WARNING: CPU: 2 PID: 7301 at fs/buffer.c:1145 __brelse+0x67/0xa0 ... Call Trace: invalidate_bh_lru+0x99/0x150 smp_call_function_many_cond+0xe2a/0x10c0 ? generic_remap_file_range_prep+0x50/0x50 ? __brelse+0xa0/0xa0 ? __mutex_lock+0x21c/0x12d0 ? smp_call_on_cpu+0x250/0x250 ? rcu_read_lock_sched_held+0xb/0x60 ? lock_release+0x587/0x810 ? __brelse+0xa0/0xa0 ? generic_remap_file_range_prep+0x50/0x50 on_each_cpu_cond_mask+0x3c/0x80 blkdev_flush_mapping+0x13a/0x2f0 blkdev_put_whole+0xd3/0xf0 blkdev_put+0x222/0x760 deactivate_locked_super+0x96/0x160 deactivate_super+0xda/0x100 cleanup_mnt+0x222/0x3d0 task_work_run+0x149/0x240 ? task_work_cancel+0x30/0x30 do_exit+0xb29/0x2a40 ? reacquire_held_locks+0x4a0/0x4a0 ? do_raw_spin_lock+0x12a/0x2b0 ? mm_update_next_owner+0x7c0/0x7c0 ? rwlock_bug.part.0+0x90/0x90 ? zap_other_threads+0x234/0x2d0 do_group_exit+0xd0/0x2a0 __x64_sys_exit_group+0x3a/0x50 do_syscall_64+0x34/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd The cause of the issue is that brelse() is called on both ofibh.sbh and ofibh.ebh by udf_find_entry() when it returns NULL. However, brelse() is called by udf_rename(), too. So, b_count on buffer_head becomes unbalanced. This patch fixes the issue by not calling brelse() by udf_rename() when udf_find_entry() returns NULL. The Linux kernel CVE team has assigned CVE-2022-50755 to this issue. Affected and fixed versions =========================== Fixed in 4.9.337 with commit 78eba2778ae10fb2a9d450e14d26eb6f6bf1f906 Fixed in 4.14.303 with commit 9d2cad69547abea961fa80426d600b861de1952b Fixed in 4.19.270 with commit d6da7ec0f94f5208c848e0e94b70f54a0bd9c587 Fixed in 5.4.229 with commit 156d440dea97deada629bb51cb17887abd862605 Fixed in 5.10.163 with commit 40dba68d418237b1ae2beaa06d46a94dd946278e Fixed in 5.15.86 with commit e7a6a53c871460727be09f4414ccb29fb8697526 Fixed in 6.0.16 with commit 4fca09045509f5bde8fc28e68fbca38cb4bdcf2e Fixed in 6.1.2 with commit 090bf49833c51da297ec74f98ad2bf44daea9311 Fixed in 6.2 with commit c791730f2554a9ebb8f18df9368dc27d4ebc38c2 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-50755 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/udf/namei.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/78eba2778ae10fb2a9d450e14d26eb6f6bf1f906 https://git.kernel.org/stable/c/9d2cad69547abea961fa80426d600b861de1952b https://git.kernel.org/stable/c/d6da7ec0f94f5208c848e0e94b70f54a0bd9c587 https://git.kernel.org/stable/c/156d440dea97deada629bb51cb17887abd862605 https://git.kernel.org/stable/c/40dba68d418237b1ae2beaa06d46a94dd946278e https://git.kernel.org/stable/c/e7a6a53c871460727be09f4414ccb29fb8697526 https://git.kernel.org/stable/c/4fca09045509f5bde8fc28e68fbca38cb4bdcf2e https://git.kernel.org/stable/c/090bf49833c51da297ec74f98ad2bf44daea9311 https://git.kernel.org/stable/c/c791730f2554a9ebb8f18df9368dc27d4ebc38c2