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 91DDC2E1C65 for ; Tue, 9 Dec 2025 01:31: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=1765243900; cv=none; b=NyqiJfDz2xCgoK6Axn1UXweuDA5A9cyIy3kXjkk004qeSqBhIsJ8p9kkHo0v/lEV1TIz7em6HyR0vVBy7L+b2fO+J/edNbNRxtYnmuTFKj85I9ngHUELKYE/JlUAIvRrHv+4Qd/89AlBVAMK7w9wUpC2yFNnaSRJX2HOddDLsEY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765243900; c=relaxed/simple; bh=d1uhjV4IMiKWMpsZ0oPtUiKep6AbSQiif8q62ifwTmA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oShuY05pp+Tby0WjfjYjnCXqj0QVkEP8HxL4Aj1L7hBMdPVFEVQl150Vu7wLJIWKJjGzR/18CyfKqa5RcqLGSWSppYCtWDqTnvRiL2EGN2E5rsjfwTrSGNQ1mQyzZpNmtnsVk3z6FbHdOm+/P+tbJcLML+hSxo5hTCsPr/Q/VUE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vxdJJLzq; 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="vxdJJLzq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFBFCC4CEF1; Tue, 9 Dec 2025 01:31:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765243900; bh=d1uhjV4IMiKWMpsZ0oPtUiKep6AbSQiif8q62ifwTmA=; h=From:To:Cc:Subject:Date:Reply-To:From; b=vxdJJLzq+CQsrtUvwzD/Cq+Bo4TYJFEs0LzXcSGouIK5EBrCQEs69ml6kODuVB91N PjjzwOKsqcQ62uqyFUiLiEXa5yIMjqh6Rz8FPdpCRWojfuEcnNf2SQXSaysxIHPCny UI/Rp7Cwimt3o0wNlsw47Pt2yuJT/cHqDr9Vs9vA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50675: arm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored Date: Tue, 9 Dec 2025 10:31:00 +0900 Message-ID: <2025120948-CVE-2022-50675-9032@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3445; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=qJf8y2c2awEn/79RfHYLtuAxtcXfm3AR3eE0aPYfnhE=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnm1Sca8uYZpTrM6jWpW/mo22p9zBS7jJc3nBjjqyUWH Jr9bdq2jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhIzgaGuXKHtpzT/CN173cG u9yWdm+2RpEoLob5Qc3Pn2xbfL/kxJpb/55EuhTf++cqCgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: arm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored Prior to commit 69e3b846d8a7 ("arm64: mte: Sync tags for pages where PTE is untagged"), mte_sync_tags() was only called for pte_tagged() entries (those mapped with PROT_MTE). Therefore mte_sync_tags() could safely use test_and_set_bit(PG_mte_tagged, &page->flags) without inadvertently setting PG_mte_tagged on an untagged page. The above commit was required as guests may enable MTE without any control at the stage 2 mapping, nor a PROT_MTE mapping in the VMM. However, the side-effect was that any page with a PTE that looked like swap (or migration) was getting PG_mte_tagged set automatically. A subsequent page copy (e.g. migration) copied the tags to the destination page even if the tags were owned by KASAN. This issue was masked by the page_kasan_tag_reset() call introduced in commit e5b8d9218951 ("arm64: mte: reset the page tag in page->flags"). When this commit was reverted (20794545c146), KASAN started reporting access faults because the overriding tags in a page did not match the original page->flags (with CONFIG_KASAN_HW_TAGS=y): BUG: KASAN: invalid-access in copy_page+0x10/0xd0 arch/arm64/lib/copy_page.S:26 Read at addr f5ff000017f2e000 by task syz-executor.1/2218 Pointer tag: [f5], memory tag: [f2] Move the PG_mte_tagged bit setting from mte_sync_tags() to the actual place where tags are cleared (mte_sync_page_tags()) or restored (mte_restore_tags()). The Linux kernel CVE team has assigned CVE-2022-50675 to this issue. Affected and fixed versions =========================== Issue introduced in 5.14 with commit 69e3b846d8a753f9f279f29531ca56b0f7563ad0 and fixed in 5.15.82 with commit 918002bdbe4328c8c0164a22e8ebf2384b80dc23 Issue introduced in 5.14 with commit 69e3b846d8a753f9f279f29531ca56b0f7563ad0 and fixed in 6.0.3 with commit 749e9fc18b1e1a3f93a9512e91bd7f93002d2821 Issue introduced in 5.14 with commit 69e3b846d8a753f9f279f29531ca56b0f7563ad0 and fixed in 6.1 with commit a8e5e5146ad08d794c58252bab00b261045ef16d 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-2022-50675 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: arch/arm64/kernel/mte.c arch/arm64/mm/mteswap.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/918002bdbe4328c8c0164a22e8ebf2384b80dc23 https://git.kernel.org/stable/c/749e9fc18b1e1a3f93a9512e91bd7f93002d2821 https://git.kernel.org/stable/c/a8e5e5146ad08d794c58252bab00b261045ef16d