From nobody Sun Feb 8 18:14:26 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) (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 181C1338F40; Fri, 6 Feb 2026 04:32:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770352334; cv=none; b=M0jpC86fAi5Nf6KSbSdJ5d2MC8Ah2RIXFqMpBtHEUM0ffELZaMyGCmggeyWtYGA/uPiYtOORPvRuyX3CuqRK4YORh4ymzUfzcES/Jz7P3kC5n0D1q6xvI1EOpK0hJMdNzXVYQsCrbdPUfEqhkkyN8KQjJb6szLV2LetV+uB489g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770352334; c=relaxed/simple; bh=BbOOS0pWroSW/3/E5wqcJrdhWdMAyw+4cG24+VR43aI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JZqni5RWa5joyfuHd5w9XOImG/wqxsXka1mtwXZJVks6Pit37JRokfpxuMI72YpxK94px52Fn64SsK16MqbeHV7V9v9IN9qv6tjsxl+BmCnWN7ONlek4CWAepjE4LVH4wZ7pO0q42J2FWwK6xV1EVN+e4Mc93gIcrwpf/Rwmw24= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=mSAH2xIy; arc=none smtp.client-ip=117.135.210.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="mSAH2xIy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=qr 3LVoOJqpEYjoT7a1xDOpnKMJ8q6Fi6UAoB055FyKQ=; b=mSAH2xIywMiN4NWJgL oOlitNnqti8W2haqwcBKXPNlMx1EiG7SwjW2jaRZuCxYTK/j/a5sd3GunkLRLm/o NBSx4t38ylHfmq1ihvSmVXS7ELxqMcQwF15NHKXOx5w8jVxh1SBI9/C0bODLhaGK fNdM0czovFKpu2KxaSMOyUe5U= Received: from ubuntu24-z.. (unknown []) by gzsmtp2 (Coremail) with SMTP id PSgvCgC3sLWbboVpASh5QQ--.27597S3; Fri, 06 Feb 2026 12:31:27 +0800 (CST) From: ranxiaokai627@163.com To: graf@amazon.com, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org, akpm@linux-foundation.org Cc: kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn, ranxiaokai627@163.com, stable@vger.kernel.org Subject: [PATCH -next 1/2] kho: fix missing early_memunmap() call in kho_populate() Date: Fri, 6 Feb 2026 04:31:20 +0000 Message-ID: <20260206043121.197564-2-ranxiaokai627@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260206043121.197564-1-ranxiaokai627@163.com> References: <20260206043121.197564-1-ranxiaokai627@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: PSgvCgC3sLWbboVpASh5QQ--.27597S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF4fAF1rGw1xtw18WFWktFb_yoW8WF4fpr yrG3WxCw48Jayqqa17J3WxW34rW3ykK3W3ta4jk34fAFnxXr1kuFWxX3WIyF12qFySgw12 yFs5tayrW3WkCFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zErcTPUUUUU= X-CM-SenderInfo: xudq5x5drntxqwsxqiywtou0bp/xtbC7R9+ymmFbp-e1AAA3R Content-Type: text/plain; charset="utf-8" From: Ran Xiaokai kho_populate() returns without calling early_memunmap() on success path, this will cause early ioremap virtual address space leak. Fixes: b50634c5e84a ("kho: cleanup error handling in kho_populate()") Signed-off-by: Ran Xiaokai --- b50634c5e84a ("kho: cleanup error handling in kho_populate()") has not landed in upstream, so Cc: is unnecessary? kernel/liveupdate/kexec_handover.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_h= andover.c index fb3a7b67676e..76b714db175d 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -1463,6 +1463,7 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fd= t_len, struct kho_scratch *scratch =3D NULL; phys_addr_t mem_map_phys; void *fdt =3D NULL; + int populated =3D 0; int err; =20 /* Validate the input FDT */ @@ -1529,16 +1530,17 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 = fdt_len, kho_in.scratch_phys =3D scratch_phys; kho_in.mem_map_phys =3D mem_map_phys; kho_scratch_cnt =3D scratch_cnt; - pr_info("found kexec handover data.\n"); =20 - return; + populated =3D 1; + pr_info("found kexec handover data.\n"); =20 err_unmap_scratch: early_memunmap(scratch, scratch_len); err_unmap_fdt: early_memunmap(fdt, fdt_len); err_report: - pr_warn("disabling KHO revival\n"); + if (!populated) + pr_warn("disabling KHO revival\n"); } =20 /* Helper functions for kexec_file_load */ --=20 2.25.1 From nobody Sun Feb 8 18:14:26 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) (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 A883C335549 for ; Fri, 6 Feb 2026 04:32:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770352328; cv=none; b=fhDbvZ956UKKrCLC9jLi6yE9fXya5JRbWzq+/GN2iSO5gEKn322FFHYOB6OGRynBEirOxFa4ZVLOX+rosGsiB2NxSqnaeJkDjo3waJRsbNAZLNR8uqGUwGEY1CXzVPlpg9RokoZtN4+Doj40tlBLUcsgoXWQmKmbaU0Ee2BvUlA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770352328; c=relaxed/simple; bh=Ti6H3e0cmsgCPpn5DWraYzL62V+k6aU8Gbe7KPqtOz4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pgM4j3X1LySqvmD+wsZ8LIm4sLeBaYGVG5BWNdEednfAezHPSnXU0TY0c8ql247/lfyDmnCPUN1EmiwOiZxrrEPTNJ68mQZcnFS6vATCU/+PksVFL2pKQltx+1xnzAonrZgJSLgsuoh89OYrWPGApS7Sn5dhagWAIaEEd4Y1qkI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=cKpH4D4H; arc=none smtp.client-ip=117.135.210.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="cKpH4D4H" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=9n M3Kd1dcWbNtOCwB4Z0eTREwnVVuKbCgjD1cpzKymA=; b=cKpH4D4Hx9iNY/B5BW kUjm7WtCX0HKyg/scUGbmFZa3O5xhwCunsL6p7OAHhe8hCevx5J6o80ubZx/F5EZ 0B+we51uE4yg/Cq6yYyx8DRzKHBI7Djf0ATuP1S/Koss+nf3UConQJlu/fKZTXah dbteSueETLGWDTkO+VO9kcvko= Received: from ubuntu24-z.. (unknown []) by gzsmtp2 (Coremail) with SMTP id PSgvCgC3sLWbboVpASh5QQ--.27597S4; Fri, 06 Feb 2026 12:31:29 +0800 (CST) From: ranxiaokai627@163.com To: graf@amazon.com, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org, akpm@linux-foundation.org Cc: kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn, ranxiaokai627@163.com Subject: [PATCH -next 2/2] kho: remove unnecessary WARN_ON(err) in kho_populate() Date: Fri, 6 Feb 2026 04:31:21 +0000 Message-ID: <20260206043121.197564-3-ranxiaokai627@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260206043121.197564-1-ranxiaokai627@163.com> References: <20260206043121.197564-1-ranxiaokai627@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: PSgvCgC3sLWbboVpASh5QQ--.27597S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw1xXw17Zr13Jr4DJF15twb_yoWfKFX_WF 4xtw40kr4q9r90vr1Yk39aqFW5K3y8ZFyqvF13XFWxJa45ta1j9a9rZwnrAFnxW34qkryq yr1qgrZ8tr4fGjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRAOzVDUUUUU== X-CM-SenderInfo: xudq5x5drntxqwsxqiywtou0bp/xtbCxQF-y2mFbqGCcwAA3i Content-Type: text/plain; charset="utf-8" From: Ran Xiaokai The following pr_warn() provides detailed error and location information, WARN_ON(err) adds no additional debugging value, so remove the redundant WARN_ON() call. Signed-off-by: Ran Xiaokai Reviewed-by: Pasha Tatashin --- kernel/liveupdate/kexec_handover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_h= andover.c index 76b714db175d..b851b09a8e99 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -1507,7 +1507,7 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fd= t_len, =20 memblock_add(area->addr, size); err =3D memblock_mark_kho_scratch(area->addr, size); - if (WARN_ON(err)) { + if (err) { pr_warn("failed to mark the scratch region 0x%pa+0x%pa: %pe", &area->addr, &size, ERR_PTR(err)); goto err_unmap_scratch; --=20 2.25.1