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 BEC9A7E58F for ; Wed, 22 May 2024 08:20:15 +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=1716366015; cv=none; b=dtd0fkqNL6T/TMtifYposeu51zFhMdp6sLHLyFCMcKBEIir3LO4kqwNt4BbJU9LGWKd6/O/HmCI8XGVSV3pJmssm2CO9mG3L+XGcGnBxVIpD+3ezPHrB39phA3jJ2OWjwgBKxbiU+Udu3RJN1zPzs07j4Oiyue/7shx702vY6fM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716366015; c=relaxed/simple; bh=CtYg6unK7cyYWBZtPG1Z3aam4ADBn0MR6fM3tlmYWQY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IU8+aTgPwGFO/ddzKcqQeia5h8EyS1ub0JtgJGx5jgvSVeMQicQMfT+rVT8ILWNcF5EB4ibktFAZhgD55DCleuEYWEB31wf3FqxFbpgUJIhh5IGluY+65S6bPawe9K5u7aqU5Gso14/8ruhwIPQog+J6joxHT415pA5lZgn1MfM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vDvNIad7; 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="vDvNIad7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0D17C2BD11; Wed, 22 May 2024 08:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716366015; bh=CtYg6unK7cyYWBZtPG1Z3aam4ADBn0MR6fM3tlmYWQY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=vDvNIad7KrI+b47gn7yORReFOdPhobjQ0DOFK7eTGsjmlbYv6sKXiwkM6maIuGZaj zT3cPYraPUXsXa6kZF1kGVeZM5Jay4Eb0HOXvt0HaCMCO47wrsp3ZtNk34WqY+Kwlx WcrAAlkYEG2Za6XuDx+O2b/ans14F8XlYbKXvYrw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47491: mm: khugepaged: skip huge page collapse for special files Date: Wed, 22 May 2024 10:19:51 +0200 Message-ID: <2024052241-CVE-2021-47491-437d@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=2383; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=CtYg6unK7cyYWBZtPG1Z3aam4ADBn0MR6fM3tlmYWQY=; b=owGbwMvMwCRo6H6F97bub03G02pJDGm+q+Y69ermT/h/4Oq+z1Nes57MPznj+3d9ZrOXyhw7Q vZdT7wg3xHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATSTdkmGe5NXTfAuWtV03P GH/PtEu+Gbk1r5JhrqTP4vfr5u7VUevT2+laqvvslRnfPAA= 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: mm: khugepaged: skip huge page collapse for special files The read-only THP for filesystems will collapse THP for files opened readonly and mapped with VM_EXEC. The intended usecase is to avoid TLB misses for large text segments. But it doesn't restrict the file types so a THP could be collapsed for a non-regular file, for example, block device, if it is opened readonly and mapped with EXEC permission. This may cause bugs, like [1] and [2]. This is definitely not the intended usecase, so just collapse THP for regular files in order to close the attack surface. [shy828301@gmail.com: fix vm_file check [3]] The Linux kernel CVE team has assigned CVE-2021-47491 to this issue. Affected and fixed versions =========================== Issue introduced in 5.4 with commit 99cb0dbd47a1 and fixed in 5.10.78 with commit 6d67b2a73b8e Issue introduced in 5.4 with commit 99cb0dbd47a1 and fixed in 5.14.16 with commit 5fcb6fce74ff Issue introduced in 5.4 with commit 99cb0dbd47a1 and fixed in 5.15 with commit a4aeaa06d45e 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-47491 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/khugepaged.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/6d67b2a73b8e3a079c355bab3c1aef7d85a044b8 https://git.kernel.org/stable/c/5fcb6fce74ffa614d964667110cf1a516c48c6d9 https://git.kernel.org/stable/c/a4aeaa06d45e90f9b279f0b09de84bd00006e733