From mboxrd@z Thu Jan 1 00:00:00 1970 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 925E6146A97 for ; Tue, 21 May 2024 15:39:56 +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=1716305996; cv=none; b=DH1EZaytfsJ4ArRoIU+pVnWyyRMC7Zr5iX5LzJgVa/H9byJs1xqhsA9oRXeYPYZh+4MhH56PZ0M9Lat0gqqNt5wnBRy+9Us7q2a/UEI4YCPHX+I1b2/SMzA9YCbhmZ1zX5ii54DG+TD54HiKFHVIMWLxlYmFxleuKxRzIgrSdBg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716305996; c=relaxed/simple; bh=3g836S1gBPtHwNPtsK7+NhNuWAqal6jfbrm8YyyA6+Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bhUZJEDUq4ZDsuthnLHhq/nAbzr9igv3XC1Ei1/uSXy7LOBYuPmDfx2cP/KA6dCd45eaFDmVbIY0pCnw4nU05cZAr6yQXIU17IQoY2XS7IqvUdJWu3XOPgIpwJ48GS/O8wycKhcoDVzjX+/Qohrf341YR+qIXyOTDv3LSz1MDzU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BtF9NqoH; 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="BtF9NqoH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D59FC2BD11; Tue, 21 May 2024 15:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716305996; bh=3g836S1gBPtHwNPtsK7+NhNuWAqal6jfbrm8YyyA6+Y=; h=From:To:Cc:Subject:Date:Reply-to:From; b=BtF9NqoH6bVC1Hmc3KXFej4ticR0fJLw5KHu738m7UcD1UtXpTZsM0GPsGKXnnb08 vRzHs+2af0pl2YtghPygNB07TitsHrs/9n0Af1yhg9WYlOYfmxclWnsf15biWFjFTH gnXQ6zOcTjuN1xtfDWPpebHrygvHvDycNDhwzOX8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52848: f2fs: fix to drop meta_inode's page cache in f2fs_put_super() Date: Tue, 21 May 2024 17:32:24 +0200 Message-ID: <2024052113-CVE-2023-52848-a5fa@gregkh> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3311; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=3g836S1gBPtHwNPtsK7+NhNuWAqal6jfbrm8YyyA6+Y=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk++xzv6f73sft06B77PbFpC5U9Zn5JNJgs3qzoevB5m FZrLmNyRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEykI4xhwT45rqnW04/PnTJH WL227W1j5fkZ1gwLzgSsWfeu1GXq0vVF67n2tFwInxr2BgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: f2fs: fix to drop meta_inode's page cache in f2fs_put_super() syzbot reports a kernel bug as below: F2FS-fs (loop1): detect filesystem reference count leak during umount, type: 10, count: 1 kernel BUG at fs/f2fs/super.c:1639! CPU: 0 PID: 15451 Comm: syz-executor.1 Not tainted 6.5.0-syzkaller-09338-ge0152e7481c6 #0 RIP: 0010:f2fs_put_super+0xce1/0xed0 fs/f2fs/super.c:1639 Call Trace: generic_shutdown_super+0x161/0x3c0 fs/super.c:693 kill_block_super+0x3b/0x70 fs/super.c:1646 kill_f2fs_super+0x2b7/0x3d0 fs/f2fs/super.c:4879 deactivate_locked_super+0x9a/0x170 fs/super.c:481 deactivate_super+0xde/0x100 fs/super.c:514 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd In f2fs_put_super(), it tries to do sanity check on dirty and IO reference count of f2fs, once there is any reference count leak, it will trigger panic. The root case is, during f2fs_put_super(), if there is any IO error in f2fs_wait_on_all_pages(), we missed to truncate meta_inode's page cache later, result in panic, fix this case. The Linux kernel CVE team has assigned CVE-2023-52848 to this issue. Affected and fixed versions =========================== Issue introduced in 6.5 with commit 20872584b8c0 and fixed in 6.5.12 with commit eb42e1862aa7 Issue introduced in 6.5 with commit 20872584b8c0 and fixed in 6.6.2 with commit 10b2a6c0dade Issue introduced in 6.5 with commit 20872584b8c0 and fixed in 6.7 with commit a4639380bbe6 Issue introduced in 6.4.16 with commit 0e2577074b45 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-2023-52848 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/f2fs/super.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/eb42e1862aa7934c2c21890097ce4993c5e0d192 https://git.kernel.org/stable/c/10b2a6c0dade67b5a2b2d17fb75c457ea1985fad https://git.kernel.org/stable/c/a4639380bbe66172df329f8b54aa7d2e943f0f64