From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796237569; b=spDGuqCaHV3e04CyXrDaakIGMgOUpAX9RkMGzgApzO4fFBvMVwkYOj/6E54CQ6p2bGIE 7WFOrcVmZ5QJgbso+W564ygfbkxqvOSz42af0cSHMLpvMOUHeAfQGD2pECkr90BE7YNCf UUJ/LGbNIGxYYJHyI/t0J4wst6eAw9MKdZovh+7NDz+KwKOwOtolqjbN0fEt2kYk1NXvk Kwn9Er8YWFab91N0i3ux2dRTjjQi250W6zIEhRoklBPWJn/y3hYJA8YaD5OFaUDRAQOkH ygJqzRfG3AFtiBZR4S4ioNQGOrl4UzgbbRCjmge3a5+Y1GvWiLrwrKIB7YDhJikNsvQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796237569; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=4dlsVtdhC36wNhvbIGoJMd5/J6VBJsB0rnH2/Qbz+Vw=; b=J2nf6CDq87w1xmRuVcfknABxMnpJr3skMlYyR1l2oegOKhgzVJ7v+eTVKIJqCruDr1Uw Pm8hNER8mwVYhVeqQy2lBaFB8aabVnzAIsSlEchalWz9FazyoOXcUATjF6U3H45GG/1/F a7llWKi3NC3GQX/u4Ck8Dvhr/2qBDHFDjzkhbJQY5jzMxqF3FXe+5MnbYmqLTJaRim86Y M4o0gdXvvMl04offWF9wTvJ/gesDVlZjmqUMMTr4X8FSCu8mWxsxbZXbuZ2ptm+QOLQoV AkFU9y97Ir+BlHoZ5n6fd3QEOab30XAjwDaCg9m/qdf74v9UYVCrYsECvggHwfGm0ew== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=Gu7KIj8R; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6826A606A32D for ; Wed, 2 Dec 2026 18:52:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=Gu7KIj8R Received: by smtp.kernel.org (Postfix) with ESMTPSA id C69F71F000C1; Wed, 2 Dec 2026 18:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796237568; bh=4dlsVtdhC36wNhvbIGoJMd5/J6VBJsB0rnH2/Qbz+Vw=; h=Date:To:From:In-Reply-To:References:Subject; b=Gu7KIj8RgVQpb7YLuCnyxWGpXgOgJgRYxWbCH/uAifQ0lqZJDc7i4mcc1oHoNOvXI +w9sF8ihWZuibLbdsqwIsVH/CiWyaNCNLXVzMVt3A7gcYMsGAfGhJEX6tbEykZ6UTl MAyaaNpiZ1gvUcmTw8tZU1qSSBBbHc/qPq6S2BKE= Date: Wed, 02 Dec 2026 10:52:48 -0800 To: mm-commits@vger.kernel.org,david@kernel.org,rppt@kernel.org, akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261202164612.1573222-1-rppt@kernel.org> References: <20261202164612.1573222-1-rppt@kernel.org> Subject: + mm-fake-numa-fix-leak-of-the-distance-table-copy-on-errors.patch added to mm-unstable branch Message-Id: <20261202185248.C69F71F000C1@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: mm/fake-numa: fix leak of the distance table copy on errors has been added to the -mm mm-unstable branch. Its filename is mm-fake-numa-fix-leak-of-the-distance-table-copy-on-errors.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-fake-numa-fix-leak-of-the-distance-table-copy-on-errors.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: "Mike Rapoport (Microsoft)" Subject: mm/fake-numa: fix leak of the distance table copy on errors Date: Wed, 02 Dec 2026 18:46:11 +0200 numa_emulation() copies the physical distance table before calling fix_pxm_node_maps(), but if fix_pxm_node_maps() fails, the copy is never freed. This only happens with numa=fake= setups that fix_pxm_node_maps() already warns about, and leaks a single page on systems with up to 64 nodes. Free the copy at no_emu. memblock_free() ignores NULL, so this is safe for the errors that happen before the table is copied. Link: https://patch.msgid.link/20261202164612.1573222-1-rppt@kernel.org Fixes: 63db8170bf34 ("mm/fake-numa: allow later numa node hotplug") Signed-off-by: Mike Rapoport (Microsoft) Signed-off-by: Andrew Morton Reported-by: Sashiko Closes: https://sashiko.dev/bug/linux-96a473a0-2815-4091-910e-970513fa6467 Reviewed-by: David Hildenbrand (Arm) mm/numa_emulation.c | 1 + 1 file changed, 1 insertion(+) --- a/mm/numa_emulation.c~mm-fake-numa-fix-leak-of-the-distance-table-copy-on-errors +++ a/mm/numa_emulation.c @@ -546,6 +546,7 @@ void __init numa_emulation(struct numa_m return; no_emu: + memblock_free(phys_dist, phys_size); numa_nodes_parsed = physnode_mask; /* No emulation. Build identity emu_nid_to_phys[] for numa_add_cpu() */ for (i = 0; i < ARRAY_SIZE(emu_nid_to_phys); i++) _ Patches currently in -mm which might be from rppt@kernel.org are mm-cma-simplify-cma_declare_contiguous_multi.patch mm-fake-numa-fix-leak-of-the-distance-table-copy-on-errors.patch hibernation-make-swsusp_page-helpers-static.patch hibernation-ensure-secretmem-pages-dont-reach-a-snapshot.patch hibernate-handle-potential-errors-in-hibernate_mapunmap_page.patch hibernation-kfence-explicitly-map-unmap-kfence-pages.patch hibernation-make-hibernation-unavailable-when-debug_pagealloc-is-on.patch