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 C4A65199242 for ; Tue, 16 Jul 2024 11:47:45 +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=1721130465; cv=none; b=GgPtvzqq7omjF0jFrrE82pHsMe0CnM15VjP1LjkQMiDNGU52yinwD0K2LLrA1h9Z8DxGUEeRbS2WgZtfI9TzdszTqyvTf46B81AmQAQMXBpUZhfj2K1aGsa96c1+mElajAhtWGhFpn5dmJZYr9XKsRHOIn+7hzU2RCaSKTeG/Vc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721130465; c=relaxed/simple; bh=V2XtrZKSLGq6heDDgYtCFS7yOF5a6PeTYwCHZutv1o8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d+GhRmmsEjl0Bp/x8U0+hzApZlW9HsC2+3EJ9m2kG1Pil5mNwe5wafSwP2qVtddpwYA7l2gFZ2bq8lyT7YDA6+kCCDNgDY23e1d8Lu5O/wZheqOcJtoGGJlFGl0yFgzDsV9cF/DnFv2CRcKg9vmJ7b5djU6uZCmQMrBlmZUmcgc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2Hf/7ofx; 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="2Hf/7ofx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CB7AC116B1; Tue, 16 Jul 2024 11:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721130465; bh=V2XtrZKSLGq6heDDgYtCFS7yOF5a6PeTYwCHZutv1o8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=2Hf/7ofxgemQOHAnT/nvj4CojCp2/PANzv3wIx3/D95rOiqUTUsnt2VKBIq7aDrTx KmPcTsJr/OSvFLsDH1H3boO3o67FmMonaPdtfFed8hE8dSQf3L8bnOIvFDTBoJybYQ mulmWEZnm3IGztd7S4UBucpFGwybv3xL5c8lBRps= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48800: mm: vmscan: remove deadlock due to throttling failing to make progress Date: Tue, 16 Jul 2024 13:45:52 +0200 Message-ID: <2024071643-CVE-2022-48800-5ff8@gregkh> X-Mailer: git-send-email 2.45.2 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=3653; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=V2XtrZKSLGq6heDDgYtCFS7yOF5a6PeTYwCHZutv1o8=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnTYtO/Lc67VuNeK1Ww5OWUWXusyivYti5Y68n+9Pq6o 9Vur/OmdsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEOoQZFrQJhfBun7V7Umaz 8fuyrxMikplvPWWYwzuh2+irtO/9lBDOuDJ7zuWvj9V9AQA= 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: vmscan: remove deadlock due to throttling failing to make progress A soft lockup bug in kcompactd was reported in a private bugzilla with the following visible in dmesg; watchdog: BUG: soft lockup - CPU#33 stuck for 26s! [kcompactd0:479] watchdog: BUG: soft lockup - CPU#33 stuck for 52s! [kcompactd0:479] watchdog: BUG: soft lockup - CPU#33 stuck for 78s! [kcompactd0:479] watchdog: BUG: soft lockup - CPU#33 stuck for 104s! [kcompactd0:479] The machine had 256G of RAM with no swap and an earlier failed allocation indicated that node 0 where kcompactd was run was potentially unreclaimable; Node 0 active_anon:29355112kB inactive_anon:2913528kB active_file:0kB inactive_file:0kB unevictable:64kB isolated(anon):0kB isolated(file):0kB mapped:8kB dirty:0kB writeback:0kB shmem:26780kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 23480320kB writeback_tmp:0kB kernel_stack:2272kB pagetables:24500kB all_unreclaimable? yes Vlastimil Babka investigated a crash dump and found that a task migrating pages was trying to drain PCP lists; PID: 52922 TASK: ffff969f820e5000 CPU: 19 COMMAND: "kworker/u128:3" Call Trace: __schedule schedule schedule_timeout wait_for_completion __flush_work __drain_all_pages __alloc_pages_slowpath.constprop.114 __alloc_pages alloc_migration_target migrate_pages migrate_to_node do_migrate_pages cpuset_migrate_mm_workfn process_one_work worker_thread kthread ret_from_fork This failure is specific to CONFIG_PREEMPT=n builds. The root of the problem is that kcompact0 is not rescheduling on a CPU while a task that has isolated a large number of the pages from the LRU is waiting on kcompact0 to reschedule so the pages can be released. While shrink_inactive_list() only loops once around too_many_isolated, reclaim can continue without rescheduling if sc->skipped_deactivate == 1 which could happen if there was no file LRU and the inactive anon list was not low. The Linux kernel CVE team has assigned CVE-2022-48800 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit d818fca1cac3 and fixed in 5.16.10 with commit 3980cff63496 Issue introduced in 5.16 with commit d818fca1cac3 and fixed in 5.17 with commit b485c6f1f9f5 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-48800 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/vmscan.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/3980cff6349687f73d5109f156f23cb261c24164 https://git.kernel.org/stable/c/b485c6f1f9f54b81443efda5f3d8a5036ba2cd91