From mboxrd@z Thu Jan 1 00:00:00 1970 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 4F31C313297 for ; Wed, 19 Nov 2025 07:14:42 +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=1763536482; cv=none; b=OJgVCeJYiHeltH+dWvmjXYb0itEJOtODxwAuHxe0NfGSOApBwS4o0cfzC7k9Mf9ZAXZIprIkfVLTE/gdaF5Ff6kFke/GkZlSfmlWisLpICs5Av74nuG9P5FpSSzbh2QjqRFhEZ9z2ruzLKcN3L0hqmzV5hQY+0/HrczxtXIwub0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763536482; c=relaxed/simple; bh=KnK2LwaTVxpBAnGwrP0tBXDqK6jOFJ6w3qTM2i6eO4E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=prHthfEqmG2DXk60TuA7ZnPN/xZBI84kHjIxg8jRPv1zoSCeYGXF7b0OWVykGwj3pMy8wMquayhCN5NprCSBBZW7iikfQofptT3TtUjITw+FHjzAEScNdW8z4kwJaIQorlO64n4Z0L0xj+zuzGc4B8qKZCmMY8yDhIYD17EDfEg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iYCBeCyD; 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="iYCBeCyD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE36AC16AAE; Wed, 19 Nov 2025 07:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763536481; bh=KnK2LwaTVxpBAnGwrP0tBXDqK6jOFJ6w3qTM2i6eO4E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iYCBeCyDe0Hmh4FfKgfEdzfAO4ZrQf8bQrN0P2JurnGdjoWncjpN00tOiseNAHhyD pr2K27K7CR068BZewS9sL54E9liZKy8YPv0UZDU1S233GRIVK5kmL3wE2xnqvhYFx7 qEOnarB+NxZFiQU5OWNtyj8q2WMAr6MTS1UDc3l2JfBFKyn1N8fgnKyFh4WDZBhbEA 00KFkpNarLFddOUnoDL4rgiEcaRLIL09Y1Sefcpdrl416oYCEc26BTywiDxOBwFVDP ie684kTjlQMNESnMb239J95/Sj6TLRC3DNn4exOGC4YZ1MhWuqHxh2Dy6kpxiJCjHc xu2xYl817psIg== Date: Wed, 19 Nov 2025 09:14:34 +0200 From: Mike Rapoport To: Pratyush Yadav Cc: Andrew Morton , Alexander Graf , Pasha Tatashin , David Matlack , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kho: free chunks using free_page() instead of kfree() Message-ID: References: <20251118182218.63044-1-pratyush@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251118182218.63044-1-pratyush@kernel.org> On Tue, Nov 18, 2025 at 07:22:16PM +0100, Pratyush Yadav wrote: > 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 allocator") > Signed-off-by: Pratyush Yadav Reviewed-by: Mike Rapoport (Microsoft) > --- > > 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_handover.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 *first_chunk) > struct khoser_mem_chunk *tmp = chunk; > > chunk = KHOSER_LOAD_PTR(chunk->hdr.next); > - kfree(tmp); > + free_page((unsigned long)tmp); > } > } > > > base-commit: f0bfdc2b69f5c600b88ee484c01b213712c63d94 > prerequisite-patch-id: f54df1de9bdcb4fe396940cdcc578f5adcc9397c > prerequisite-patch-id: 800ec910c37120fd77aff1fad8ec10daaeaeddb1 > -- > 2.47.3 > -- Sincerely yours, Mike.