From nobody Tue Dec 2 02:37:21 2025 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 8EE0E2D73B3 for ; Tue, 18 Nov 2025 18:22:23 +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=1763490143; cv=none; b=stk1WdF3xYRyM4vvjde/h6JClTNqOhJc7KmNRjQsF4gJDOhaqCIVzqyx2fJsDmip2fDaybzPYfAWNeYmF0e9Wlz7h8xrP4l4IdPrMVpYLhz0aTfhscU0FZcF79dAtdn0Gsvl86OX6FzyMt7wE3d39kLtPo5cFgHnh6PMDEnO/CE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763490143; c=relaxed/simple; bh=uzS720AirCAjrMk0zf7E+fhaADPKoEUqjQkc9kLBcHM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ImoEN9c57eAsA9TwpQWpKINdJWMQX+OYhFjuytKnxZqqqnzKsGIfhoSObyYTiw8YZ95bd+lQ/g5JhgI4NrNs2QZfxJjftWVTIgSY9/xXHkmhyRxHvMbFe9ga3j0r/tcbJAB1MErgxh5h/i4xcMO0OgjYousHgFokqf4lkpOnYjE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N2Lpuo2g; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N2Lpuo2g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E85EC116B1; Tue, 18 Nov 2025 18:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763490142; bh=uzS720AirCAjrMk0zf7E+fhaADPKoEUqjQkc9kLBcHM=; h=From:To:Cc:Subject:Date:From; b=N2Lpuo2gjYgnW1qXmgvYExPmrxjrbXMnmciJEvMO2ppCTNo9jYroJ4Qt5fNf5Dejm 2Eoi5IKxD7jLGCpyN49cQ3ynn7AyFb4n9DveQ+GsmXnBX4wsVd/0yJXJ4PbYF3JCOU 2HbUAWCaJtfVer2FyB7TzlipCCzuWoMpHlykP8oVOjdtALt6fBOrzVJN5WU55CbhYW pYd4sovXWm1lsYK/3pSbyup1udeW0/RTPfRXV/OIgaKEcs1qCDPQPStXxyJPCpyEL1 g63+BWAOExeD3zpDrPJyBSmqeX6T3Rk+RMfbwdTvw48MsE1DlszyWusQ/efDdc0vS7 yP49q1AvL5VJA== From: Pratyush Yadav To: Andrew Morton , Alexander Graf , Mike Rapoport , Pasha Tatashin , Pratyush Yadav , David Matlack Cc: kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] kho: free chunks using free_page() instead of kfree() Date: Tue, 18 Nov 2025 19:22:16 +0100 Message-ID: <20251118182218.63044-1-pratyush@kernel.org> X-Mailer: git-send-email 2.51.2 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 Content-Type: text/plain; charset="utf-8" Before commit fa759cd75bce5 ("kho: allocate metadata directly from the buddy allocator"), the chunks were allocated from the slab allocator using kzalloc(). Those were rightly freed using kfree(). When the commit switched to using the buddy allocator directly, it missed updating kho_mem_ser_free() to use free_page() instead of kfree(). Fixes: fa759cd75bce5 ("kho: allocate metadata directly from the buddy alloc= ator") Signed-off-by: Pratyush Yadav Reviewed-by: Mike Rapoport (Microsoft) Reviewed-by: Pasha Tatashin --- Notes: Commit 73976b0f7cefe ("kho: remove abort functionality and support state refresh") made this bug easier to trigger by providing a deterministic method to trigger freeing of the chunks. 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 515339fa526e0..6497fe68c2d24 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -360,7 +360,7 @@ static void kho_mem_ser_free(struct khoser_mem_chunk *f= irst_chunk) struct khoser_mem_chunk *tmp =3D chunk; =20 chunk =3D KHOSER_LOAD_PTR(chunk->hdr.next); - kfree(tmp); + free_page((unsigned long)tmp); } } =20 base-commit: f0bfdc2b69f5c600b88ee484c01b213712c63d94 prerequisite-patch-id: f54df1de9bdcb4fe396940cdcc578f5adcc9397c prerequisite-patch-id: 800ec910c37120fd77aff1fad8ec10daaeaeddb1 --=20 2.47.3