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 2454F481A3 for ; Wed, 1 May 2024 05:32:02 +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=1714541522; cv=none; b=rOBeDtTv+jvp0LJDv/Z3JZwzjoW4Io6QNjl0xY6FlBiIKSX+09kyIWi8wJfnJYtcy+6JhQe4BEqE7dbL4JVIl/5NOZRT4w8aBCerlzj+QrFrTDkT1jMRbn1a6jhZmlHIiFbUMShWG61zVWweIHTm9+KB4vVh5P4+7XHoOUcm0rY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714541522; c=relaxed/simple; bh=Zkhxyi0Xa30h4xNr9lYzUfUwCrp/5Kd1cIgCbxysVJ8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OGux8M2xi4lxyo/uZMNAVt1E4R+uxGOCxyimxutbRLTo6N4ui+OjrMHDYiv0248Pii1Z+0g5JSYXeqzbOoyEBTcQ5UUPnzs4YWkUYSSTDxgkeWDu7V/iwLRu/dfV/G67OTYXVCXCx2x/3Vb6RBz3lXSdDwpO9b28+lvTM7kVykU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=shz1h8wu; 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="shz1h8wu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3332C113CC; Wed, 1 May 2024 05:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714541522; bh=Zkhxyi0Xa30h4xNr9lYzUfUwCrp/5Kd1cIgCbxysVJ8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=shz1h8wu2GZJp5ntvOZfUbwAb2SRgHihZfhJrQFninWRpP1AZEcRpJY9G7BgwlwIi pycF5Qg4/1aG24iQgYCggPqA50NpdSCG96eW9X8CJXkw6OgT2w0fzhQD9OFf8ndP5T ADFREb8D5LqtNyd/teaT3CCGub4ecEwZjgphWKis= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-27007: userfaultfd: change src_folio after ensuring it's unpinned in UFFDIO_MOVE Date: Wed, 1 May 2024 07:31:08 +0200 Message-ID: <2024050147-CVE-2024-27007-686b@gregkh> X-Mailer: git-send-email 2.44.0 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=2014; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Zkhxyi0Xa30h4xNr9lYzUfUwCrp/5Kd1cIgCbxysVJ8=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmGl9ujy509fFUvShQH6U/kXyqiFsPemLJu04k//5mWd qXW5TzviGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIk8j2FYsOLBnPIze+9/+6l8 ytJHomWapsD5KIb5wfPszO48vfPUPWb+qZC/VVuvOmuXAgA= 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: userfaultfd: change src_folio after ensuring it's unpinned in UFFDIO_MOVE Commit d7a08838ab74 ("mm: userfaultfd: fix unexpected change to src_folio when UFFDIO_MOVE fails") moved the src_folio->{mapping, index} changing to after clearing the page-table and ensuring that it's not pinned. This avoids failure of swapout+migration and possibly memory corruption. However, the commit missed fixing it in the huge-page case. The Linux kernel CVE team has assigned CVE-2024-27007 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit adef440691ba and fixed in 6.8.8 with commit df5f6e683e7f Issue introduced in 6.8 with commit adef440691ba and fixed in 6.9-rc5 with commit c0205eaf3af9 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-27007 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: mm/huge_memory.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/df5f6e683e7f21a15d8be6e7a0c7a46436963ebe https://git.kernel.org/stable/c/c0205eaf3af9f5db14d4b5ee4abacf4a583c3c50