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 5EC4E1F5FA for ; Sun, 19 Jan 2025 10:18:58 +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=1737281938; cv=none; b=EjOZ4zDls5LiLg3+L8kd/Ckom/9dkrpjXAnASQInZsvX30vUp7nQBXXal8HnPBwREx5Oi/o/HMeHwkFL/l7CZ/EzdSV8dFl1FykOCGTsR9jG0Rvpze2PVQdzuCKfG4y9yqUt6A5F8q9APcNbqYSGHI2ZhlPOvshmZxx9dodbg1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737281938; c=relaxed/simple; bh=xwdKyiBoEVHbwTyGdVNnS12xzTSDGAJW16C/O04fdgM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=p3CC5IOGAQHdYy4duwt/GeRaqlsOQ6ShBwB5H/bHNdC9wIo4/Cgwt8Mx/uctXgqS1uwgcvOcc9Vg3Lp81HcA8t3bgq7gxxIS3C1R0Qjhot+p3qZ68+K9WkpcucGrKlyAKxMypOINuEL+cHvOEF8ZubbYfammK7z/Y7QwKEOhOlk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Zl5TONaI; 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="Zl5TONaI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80BCAC4CED6; Sun, 19 Jan 2025 10:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1737281937; bh=xwdKyiBoEVHbwTyGdVNnS12xzTSDGAJW16C/O04fdgM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Zl5TONaIIm9T9G6wcIbRoU+7fayhiwG6ybPZQ7C2nVlwSboNQjmcAG4YHH2PGH8W1 yI/buzCr6OKMaXipMn2zLxy/GWfHfkMLCtziB1vS0+wv+hYO980ZTEVtj8LxRCK97p NFjfRWA+7HlRzYV+hMRrOmiBzL8nGZnfVWa12Zeo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21643: netfs: Fix kernel async DIO Date: Sun, 19 Jan 2025 11:17:52 +0100 Message-ID: <2025011945-CVE-2025-21643-f3f6@gregkh> X-Mailer: git-send-email 2.48.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=2796; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=xwdKyiBoEVHbwTyGdVNnS12xzTSDGAJW16C/O04fdgM=; b=owGbwMvMwCRo6H6F97bub03G02pJDOk9Fz3/LAjmtpyfp1dh2Z8rw2wUdG56iqI+p92JUzkG3 KlnTt3viGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIncPcGwYO9cw28b7N07u94G Xd1+8JTv1HDrMwzzHV4tabWKLV+6X2Fz9ev2f/pdjFVXAQ== 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: netfs: Fix kernel async DIO Netfslib needs to be able to handle kernel-initiated asynchronous DIO that is supplied with a bio_vec[] array. Currently, because of the async flag, this gets passed to netfs_extract_user_iter() which throws a warning and fails because it only handles IOVEC and UBUF iterators. This can be triggered through a combination of cifs and a loopback blockdev with something like: mount //my/cifs/share /foo dd if=/dev/zero of=/foo/m0 bs=4K count=1K losetup --sector-size 4096 --direct-io=on /dev/loop2046 /foo/m0 echo hello >/dev/loop2046 This causes the following to appear in syslog: WARNING: CPU: 2 PID: 109 at fs/netfs/iterator.c:50 netfs_extract_user_iter+0x170/0x250 [netfs] and the write to fail. Fix this by removing the check in netfs_unbuffered_write_iter_locked() that causes async kernel DIO writes to be handled as userspace writes. Note that this change relies on the kernel caller maintaining the existence of the bio_vec array (or kvec[] or folio_queue) until the op is complete. The Linux kernel CVE team has assigned CVE-2025-21643 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit 153a9961b551101cd38e94e26cd92fbfd198b19b and fixed in 6.12.10 with commit 9f3a265836844eda30bf34c2584b8011fd4f0f49 Issue introduced in 6.8 with commit 153a9961b551101cd38e94e26cd92fbfd198b19b and fixed in 6.13-rc7 with commit 3f6bc9e3ab9b127171d39f9ac6eca1abb693b731 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-21643 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/netfs/direct_write.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/9f3a265836844eda30bf34c2584b8011fd4f0f49 https://git.kernel.org/stable/c/3f6bc9e3ab9b127171d39f9ac6eca1abb693b731