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 9C6BA19E7F7 for ; Tue, 7 Oct 2025 15:20:06 +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=1759850406; cv=none; b=MWMouQYxw64OfIfUpYJtOh3OLPcn2fZbWrlbx1KhZDgJtHHnlpnrW0TF1fvgw17SfYnC1oUXsXqoqjmsshuiKwLyRfztsWA9wUOHB7/THehMEofZKUldhyW6DOHVIfziNIUVC/7Qls9PLWokrckN8kRkpoAWoyJprOUBXAPIXhY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850406; c=relaxed/simple; bh=6Im6YrWDYcVCUmtAZ1V2LB7U1QutVBwQ9LGIKPlOdoc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VOKFnKCGkAQSzZubkw1oTVK62fxiuQTlVwYya0vqm1uFUOLwqPHzPYp/ZRn82fTFuJApCZbf4/xs+Yve150eN1IubgEbMB0hysRBcqrUcAxF378mF7KqE8slsHsXLWpohyMoHrcUD27I9QjnQjpbUPnP2mzpy5YkQinjkjf2xsA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WId9k1w+; 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="WId9k1w+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADDD1C4CEF1; Tue, 7 Oct 2025 15:20:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759850406; bh=6Im6YrWDYcVCUmtAZ1V2LB7U1QutVBwQ9LGIKPlOdoc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=WId9k1w+1hsQRF+VRy1XkScbs9mEUsLc1Kq2KMR6dXQQDlCIablC0O3vMwZiRZMO4 4v6WEY/tMAkshs2svX1/h+kpsRLZkn544pg1uiynGZcWk1gh8fWJw0oiA84q4kkOvm DR+xfgPnZub4219UAdXtzYolLXxWEdIu664/Bzqg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50517: mm/huge_memory: do not clobber swp_entry_t during THP split Date: Tue, 7 Oct 2025 17:19:04 +0200 Message-ID: <2025100703-CVE-2022-50517-6166@gregkh> X-Mailer: git-send-email 2.51.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=4968; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=9JTZJSde26+wm943AuXVjjrEWfa0pRNqaF9RXC/Fvt4=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlP9dPP866+dixorsvJY5+mevGuirp/oke+4I6Uy7aGl YIbGZSLOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAidecYFhxL4vne1F53+Z9q xBrOueklFQ49sgzzqyJ3HbPufvJrbm2F9en5Qdp6jiJHAQ== 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: mm/huge_memory: do not clobber swp_entry_t during THP split The following has been observed when running stressng mmap since commit b653db77350c ("mm: Clear page->private when splitting or migrating a page") watchdog: BUG: soft lockup - CPU#75 stuck for 26s! [stress-ng:9546] CPU: 75 PID: 9546 Comm: stress-ng Tainted: G E 6.0.0-revert-b653db77-fix+ #29 0357d79b60fb09775f678e4f3f64ef0579ad1374 Hardware name: SGI.COM C2112-4GP3/X10DRT-P-Series, BIOS 2.0a 05/09/2016 RIP: 0010:xas_descend+0x28/0x80 Code: cc cc 0f b6 0e 48 8b 57 08 48 d3 ea 83 e2 3f 89 d0 48 83 c0 04 48 8b 44 c6 08 48 89 77 18 48 89 c1 83 e1 03 48 83 f9 02 75 08 <48> 3d fd 00 00 00 76 08 88 57 12 c3 cc cc cc cc 48 c1 e8 02 89 c2 RSP: 0018:ffffbbf02a2236a8 EFLAGS: 00000246 RAX: ffff9cab7d6a0002 RBX: ffffe04b0af88040 RCX: 0000000000000002 RDX: 0000000000000030 RSI: ffff9cab60509b60 RDI: ffffbbf02a2236c0 RBP: 0000000000000000 R08: ffff9cab60509b60 R09: ffffbbf02a2236c0 R10: 0000000000000001 R11: ffffbbf02a223698 R12: 0000000000000000 R13: ffff9cab4e28da80 R14: 0000000000039c01 R15: ffff9cab4e28da88 FS: 00007fab89b85e40(0000) GS:ffff9cea3fcc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fab84e00000 CR3: 00000040b73a4003 CR4: 00000000003706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: xas_load+0x3a/0x50 __filemap_get_folio+0x80/0x370 ? put_swap_page+0x163/0x360 pagecache_get_page+0x13/0x90 __try_to_reclaim_swap+0x50/0x190 scan_swap_map_slots+0x31e/0x670 get_swap_pages+0x226/0x3c0 folio_alloc_swap+0x1cc/0x240 add_to_swap+0x14/0x70 shrink_page_list+0x968/0xbc0 reclaim_page_list+0x70/0xf0 reclaim_pages+0xdd/0x120 madvise_cold_or_pageout_pte_range+0x814/0xf30 walk_pgd_range+0x637/0xa30 __walk_page_range+0x142/0x170 walk_page_range+0x146/0x170 madvise_pageout+0xb7/0x280 ? asm_common_interrupt+0x22/0x40 madvise_vma_behavior+0x3b7/0xac0 ? find_vma+0x4a/0x70 ? find_vma+0x64/0x70 ? madvise_vma_anon_name+0x40/0x40 madvise_walk_vmas+0xa6/0x130 do_madvise+0x2f4/0x360 __x64_sys_madvise+0x26/0x30 do_syscall_64+0x5b/0x80 ? do_syscall_64+0x67/0x80 ? syscall_exit_to_user_mode+0x17/0x40 ? do_syscall_64+0x67/0x80 ? syscall_exit_to_user_mode+0x17/0x40 ? do_syscall_64+0x67/0x80 ? do_syscall_64+0x67/0x80 ? common_interrupt+0x8b/0xa0 entry_SYSCALL_64_after_hwframe+0x63/0xcd The problem can be reproduced with the mmtests config config-workload-stressng-mmap. It does not always happen and when it triggers is variable but it has happened on multiple machines. The intent of commit b653db77350c patch was to avoid the case where PG_private is clear but folio->private is not-NULL. However, THP tail pages uses page->private for "swp_entry_t if folio_test_swapcache()" as stated in the documentation for struct folio. This patch only clobbers page->private for tail pages if the head page was not in swapcache and warns once if page->private had an unexpected value. The Linux kernel CVE team has assigned CVE-2022-50517 to this issue. Affected and fixed versions =========================== Issue introduced in 5.19 with commit b653db77350c7307a513b81856fe53e94cf42446 and fixed in 6.0.7 with commit 8cace0eeb03d6043827faa6cf6c9067a9f05cd9f Issue introduced in 5.19 with commit b653db77350c7307a513b81856fe53e94cf42446 and fixed in 6.1 with commit 71e2d666ef85d51834d658830f823560c402b8b6 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-50517 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/8cace0eeb03d6043827faa6cf6c9067a9f05cd9f https://git.kernel.org/stable/c/71e2d666ef85d51834d658830f823560c402b8b6