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 CC59278C80 for ; Wed, 22 May 2024 06:23:40 +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=1716359021; cv=none; b=m7TesNqi6tgaVeGsDvxlZ8N+9Zn0Xf029SXtNilCf+sLUyXPiVpXtgikrslPPimelCldoPRwU5Cuyyh/3MlQIGF7TIvxrPt0faPjQBVO0uKsauITitKLy0Tr1BCxJUzNnQ2ZtuT0UNsc6RsBwyXfpUkYo5xS/y/Yzrf7MJQLigU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716359021; c=relaxed/simple; bh=kSO1/l3BSJ3Q9Iatyf313OWQQGvhf8FYBW7jfQhjWW8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mnDfuOIlyGo2RjyrtL3B/qzlml5p/0xDEY9f+HSh4Kst4y2+H8AETgcSPlMd8odKzHqP57u071K7uvkkrskwdcSIWD6JJsV8wZkJuvKjh5icYZQr+86zMgol7arvBah0HqZ101Z7XUYPp2SYoPgGDlKRi/X5RmxqJLgFIbeOxCM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ebROB2Ef; 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="ebROB2Ef" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 190E8C2BD11; Wed, 22 May 2024 06:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716359020; bh=kSO1/l3BSJ3Q9Iatyf313OWQQGvhf8FYBW7jfQhjWW8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ebROB2EfDRDE5d9JXgoL30wzkOqR60uDxXMLSWULXUooqsXZVdkUBICjuEYsyn0ni 3bgV7Dxk9m5/tvGQwJiOXuvtnxvEYxqRm+iUBCLkb1q3uYeVoRXi+nk2pSNtL5NBI2 WzATaDgb/7tPu37Un4WOnPsprrkh0xD2eYkpnm2I= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47461: userfaultfd: fix a race between writeprotect and exit_mmap() Date: Wed, 22 May 2024 08:23:27 +0200 Message-ID: <2024052225-CVE-2021-47461-a472@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=2159; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=kSO1/l3BSJ3Q9Iatyf313OWQQGvhf8FYBW7jfQhjWW8=; b=owGbwMvMwCRo6H6F97bub03G02pJDGm+/bEhK/urLn4Rm+5huqz32efrzfNK3qkdFxPQW6XSo 3VYIWhmRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExkzmeGBV3b+7nZ3jfETldX uhlecGt/3jNTF4Z5pmvnzWJ7WdbNPGHefuZHoc9Vt1xJBwA= 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: fix a race between writeprotect and exit_mmap() A race is possible when a process exits, its VMAs are removed by exit_mmap() and at the same time userfaultfd_writeprotect() is called. The race was detected by KASAN on a development kernel, but it appears to be possible on vanilla kernels as well. Use mmget_not_zero() to prevent the race as done in other userfaultfd operations. The Linux kernel CVE team has assigned CVE-2021-47461 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit 63b2d4174c4a and fixed in 5.10.76 with commit 3cda4bfffd4f Issue introduced in 5.7 with commit 63b2d4174c4a and fixed in 5.14.15 with commit 149958ecd062 Issue introduced in 5.7 with commit 63b2d4174c4a and fixed in 5.15 with commit cb185d5f1ebf 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-2021-47461 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/userfaultfd.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/3cda4bfffd4f755645577aaa9e96a606657b4525 https://git.kernel.org/stable/c/149958ecd0627a9f1e9c678c25c665400054cd6a https://git.kernel.org/stable/c/cb185d5f1ebf900f4ae3bf84cee212e6dd035aca