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 95B0F256C8B for ; Fri, 22 Aug 2025 16:02:20 +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=1755878540; cv=none; b=PCynLuFrl3YhX9mtmc9uQOYgKSEfFyaCjPLRRS5zsUPnPsnpLErDU8kAOyOPtO853cJuP2cFpjJPoju52xINDXO2cew2KdAP5ZwkVckGNdGCt1O0bIirtD3EXGna90YOpOsmOpRNJ3eCvvXYqUESiszjdS/iwdA50zf2rQknp58= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755878540; c=relaxed/simple; bh=q4+R47I9QKdV2ph1PFnfIp4VMTrP2XtgEYP65r3WHAo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=eJikr8/HZnlfXq57sZbB3H7pTliKuI+a9YWh/RuX7aDX5GSdRXORQImCgUt3M2AraRBho8iOoCVIFwxPGQCB2t8Wlvgux5erWU6Y1M1yWm+eYpkQAArIeEmNoMvw1cXJvcD2jy5iaIt+zLTMrWCWCof4UV6Qe3zHehTmeSh0/p0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=G+80Ulvc; 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="G+80Ulvc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3D5EC4CEED; Fri, 22 Aug 2025 16:02:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755878540; bh=q4+R47I9QKdV2ph1PFnfIp4VMTrP2XtgEYP65r3WHAo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=G+80Ulvczt/4Zp5aQPO+6Cwp6drl+PoMJ7cIAFez+J2kcfh2dBLPgNLzrIxRQ5x2G rzYD7H3qlNCcgx+q37E5sOS0tdQmrzFh8/pVETRLII9cvk3CId64QHHB6e2bykTGt+ 7kktlgkeGZVah+C746B8fsnYxCouZQjBh84Z+470= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38652: f2fs: fix to avoid out-of-boundary access in devs.path Date: Fri, 22 Aug 2025 18:01:00 +0200 Message-ID: <2025082237-CVE-2025-38652-1f5b@gregkh> X-Mailer: git-send-email 2.50.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=3751; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=u+vMSDA9TOJqCHhXaiRU8dZiuED6SMkbyKqD5cSnSbQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkrpqiuf/mf/ff/rTdlutYJSxab743ue/JnwdPm2Ji6T 9bq3ouPdMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEzL0YFvRk8ua5bKhLtdyz /ZKCnUfNnF8h7gzzVHWvxccfmSy9/FzMpdoZx2ac2XjCDgA= 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: f2fs: fix to avoid out-of-boundary access in devs.path - touch /mnt/f2fs/012345678901234567890123456789012345678901234567890123 - truncate -s $((1024*1024*1024)) \ /mnt/f2fs/012345678901234567890123456789012345678901234567890123 - touch /mnt/f2fs/file - truncate -s $((1024*1024*1024)) /mnt/f2fs/file - mkfs.f2fs /mnt/f2fs/012345678901234567890123456789012345678901234567890123 \ -c /mnt/f2fs/file - mount /mnt/f2fs/012345678901234567890123456789012345678901234567890123 \ /mnt/f2fs/loop [16937.192225] F2FS-fs (loop0): Mount Device [ 0]: /mnt/f2fs/012345678901234567890123456789012345678901234567890123\xff\x01, 511, 0 - 3ffff [16937.192268] F2FS-fs (loop0): Failed to find devices If device path length equals to MAX_PATH_LEN, sbi->devs.path[] may not end up w/ null character due to path array is fully filled, So accidently, fields locate after path[] may be treated as part of device path, result in parsing wrong device path. struct f2fs_dev_info { ... char path[MAX_PATH_LEN]; ... }; Let's add one byte space for sbi->devs.path[] to store null character of device path string. The Linux kernel CVE team has assigned CVE-2025-38652 to this issue. Affected and fixed versions =========================== Issue introduced in 4.10 with commit 3c62be17d4f562f43fe1d03b48194399caa35aa5 and fixed in 6.1.148 with commit 3466721f06edff834f99d9f49f23eabc6b2cb78e Issue introduced in 4.10 with commit 3c62be17d4f562f43fe1d03b48194399caa35aa5 and fixed in 6.6.102 with commit 345fc8d1838f3f8be7c8ed08d86a13dedef67136 Issue introduced in 4.10 with commit 3c62be17d4f562f43fe1d03b48194399caa35aa5 and fixed in 6.12.42 with commit 70849d33130a2cf1d6010069ed200669c8651fbd Issue introduced in 4.10 with commit 3c62be17d4f562f43fe1d03b48194399caa35aa5 and fixed in 6.15.10 with commit 755427093e4294ac111c3f9e40d53f681a0fbdaa Issue introduced in 4.10 with commit 3c62be17d4f562f43fe1d03b48194399caa35aa5 and fixed in 6.16.1 with commit 1b1efa5f0e878745e94a98022e8edc675a87d78e Issue introduced in 4.10 with commit 3c62be17d4f562f43fe1d03b48194399caa35aa5 and fixed in 6.17-rc1 with commit 5661998536af52848cc4d52a377e90368196edea 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-2025-38652 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/f2fs.h 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/3466721f06edff834f99d9f49f23eabc6b2cb78e https://git.kernel.org/stable/c/345fc8d1838f3f8be7c8ed08d86a13dedef67136 https://git.kernel.org/stable/c/70849d33130a2cf1d6010069ed200669c8651fbd https://git.kernel.org/stable/c/755427093e4294ac111c3f9e40d53f681a0fbdaa https://git.kernel.org/stable/c/1b1efa5f0e878745e94a98022e8edc675a87d78e https://git.kernel.org/stable/c/5661998536af52848cc4d52a377e90368196edea