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 E7DE3197 for ; Fri, 21 Jun 2024 10:24:45 +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=1718965486; cv=none; b=FdYrjo/HZXIbynInQvlNy2mtkJUYfEm9GrdaM3Zzs+4bu5FQW26tU75GkYZD31y+Pz3mPPWNeM2OLCez986/1XB80BlewX/PLxTxo0Mxu9sIff3EztrTda+uStKl0vxg5c9GQrveGKrgHuXObFEmUTuFeWFw57ufDAZiukS1bw0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718965486; c=relaxed/simple; bh=4ifsV45vPEd6MsAx2IjGcJF0zX23QkAQyWTbnadFy3U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TzqcZ7j7GMZ9MJ0/9kbL2RD0zQHdsoo7hMdngKXM4vOyVZfl+g+idDk1BDA+IoaRHEuOyAhOaSLYUz41kRXWP3eXlFa0MSvKBjwmAGWCGs7zgyHDV5OHKuxHNBQP10x8CmnytTUNOIdveszc21mzh7skylE1jhV9OTc3O9hgdqg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UWCnwnTm; 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="UWCnwnTm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B6A7C2BBFC; Fri, 21 Jun 2024 10:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718965485; bh=4ifsV45vPEd6MsAx2IjGcJF0zX23QkAQyWTbnadFy3U=; h=From:To:Cc:Subject:Date:Reply-to:From; b=UWCnwnTmxX1CgAeDWH7W73e50dZl4K37HjKPpH8Uj7tmRnZKw/EnqIWKKvIpD4gK0 RDG98lo17x5VmGF1LUiluBmd3uJL2C//BhSj/pnRH0WGNv91/ejfkyTXKRiARYetq5 mnB71rWEPc09iymFn8wklLnShIT1NjTXwGytaEjw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-38626: fuse: clear FR_SENT when re-adding requests into pending list Date: Fri, 21 Jun 2024 12:19:52 +0200 Message-ID: <2024062140-CVE-2024-38626-88ea@gregkh> X-Mailer: git-send-email 2.45.2 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=3332; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=4ifsV45vPEd6MsAx2IjGcJF0zX23QkAQyWTbnadFy3U=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmlwXvkWd9HRlmFJiYJyDItzLgeG3P84BGf9ctfJmyPW 7co8eqjjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIo7kM88O1bh2/+NJYba5p Ve3keBP/PyJSjxjm2b+O8JTwWyv1WOxN8+Na+Z8OJ/4lAwA= 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: fuse: clear FR_SENT when re-adding requests into pending list The following warning was reported by lee bruce: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 8264 at fs/fuse/dev.c:300 fuse_request_end+0x685/0x7e0 fs/fuse/dev.c:300 Modules linked in: CPU: 0 PID: 8264 Comm: ab2 Not tainted 6.9.0-rc7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:fuse_request_end+0x685/0x7e0 fs/fuse/dev.c:300 ...... Call Trace: fuse_dev_do_read.constprop.0+0xd36/0x1dd0 fs/fuse/dev.c:1334 fuse_dev_read+0x166/0x200 fs/fuse/dev.c:1367 call_read_iter include/linux/fs.h:2104 [inline] new_sync_read fs/read_write.c:395 [inline] vfs_read+0x85b/0xba0 fs/read_write.c:476 ksys_read+0x12f/0x260 fs/read_write.c:619 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xce/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f ...... The warning is due to the FUSE_NOTIFY_RESEND notify sent by the write() syscall in the reproducer program and it happens as follows: (1) calls fuse_dev_read() to read the INIT request The read succeeds. During the read, bit FR_SENT will be set on the request. (2) calls fuse_dev_write() to send an USE_NOTIFY_RESEND notify The resend notify will resend all processing requests, so the INIT request is moved from processing list to pending list again. (3) calls fuse_dev_read() with an invalid output address fuse_dev_read() will try to copy the same INIT request to the output address, but it will fail due to the invalid address, so the INIT request is ended and triggers the warning in fuse_request_end(). Fix it by clearing FR_SENT when re-adding requests into pending list. The Linux kernel CVE team has assigned CVE-2024-38626 to this issue. Affected and fixed versions =========================== Issue introduced in 6.9 with commit 760eac73f9f6 and fixed in 6.9.4 with commit 533070db659a Issue introduced in 6.9 with commit 760eac73f9f6 and fixed in 6.10-rc1 with commit 246014876d78 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-2024-38626 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/fuse/dev.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/533070db659a9589310a743e9de14cf9d651ffaf https://git.kernel.org/stable/c/246014876d782bbf2e652267482cd2e799fb5fcd