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 C1523221DB5 for ; Wed, 28 Jan 2026 11:19:32 +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=1769599172; cv=none; b=DiY1lMAQRapN/P/IbIicIsy8QVOH+IdnNPQj/TPj2Dkrg5tXmzw5XVXjMNEwLzeUgn/hXKAfn5M5MCRx1ydzw69bUOexy0Xs+/xiLr611RRUlDudDbyrpKAQH//mDgVUenh08O2ZyVVTOFDr0to+Sg61ea/KtkORHSyy3CNigk4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769599172; c=relaxed/simple; bh=VXdMnc84zIOv8qrCFYPrv7ZeHqSlUhRquu8/asMso+M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CglRLwCwFylHI/bXQhzChbgy5NOiYlHquZxl+02jAnX8mBXVIoGyT6V0PpJTpWG7upi4MckCj0folKHElTkLZey8MyOPrJuGVgdmHJxX+MGGJOj00It3ZuMxtKWiW3xJ4xEpGaxgXPc9zP830j2LE1fzw7asr7p61oFtfko6kqE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iws81zbi; 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="iws81zbi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5832EC4CEF1; Wed, 28 Jan 2026 11:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769599172; bh=VXdMnc84zIOv8qrCFYPrv7ZeHqSlUhRquu8/asMso+M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iws81zbiLqR2d0Jknieyuaboguz7tctwvWpu06X6Q+hAeuXBr+pbQ+AtIRAk+atmY h5HSBtDK8dihmHbkWeZD/jLGGI4YO9eDuQyiY0Jh52/RQzzPaUS3oVFHsGWQD7eUNe gc7bCqcLRQiubeOFvDl6cUqqO36aDQIvER/3osWne5UnzsbxkhGM/FUvhEppSNXA94 kxK2/JrFLU5iIT2DI4WsA+Ss5AXpguuFfE51WHU5AgWR2EB8PRppEOgmEmosxQ7/T+ M8Mf3Svtpv4x9tnrhj3XF8BLByzvCPtN7RXJV5IGO9DTZvcmKh0uUaebPZwBD+l0uX rMJ332eZCPDwA== Date: Wed, 28 Jan 2026 13:19:26 +0200 From: Mike Rapoport To: Pratyush Yadav Cc: Pasha Tatashin , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/2] liveupdate: luo_file: do not clear serialized_data on unfreeze Message-ID: References: <20260126230302.2936817-1-pratyush@kernel.org> <20260126230302.2936817-2-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: <20260126230302.2936817-2-pratyush@kernel.org> On Tue, Jan 27, 2026 at 12:02:52AM +0100, Pratyush Yadav wrote: > From: "Pratyush Yadav (Google)" > > The unfreeze operation is supposed to undo the effects of the freeze > operation. serialized_data is not set by freeze, but by preserve. > Consequently, the unpreserve operation needs to access serialized_data > to undo the effects of the preserve operation. This includes freeing > the serialized data structures for example. > > If a freeze callback fails, unfreeze is called for all frozen files. > This would clear serialized_data for them. Since live update has failed, > it can be expected that userspace aborts, releasing all sessions. When > the sessions are released, unpreserve will be called for all files. The > unfrozen files will see 0 in their serialized_data. This is not expected > by file handlers, and they might either fail, leaking data and state, or > might even crash or cause invalid memory access. > > Do not clear serialized_data on unfreeze so it gets passed on to > unpreserve. There is no need to clear it on unpreserve since luo_file > will be freed immediately after. > > Fixes: 7c722a7f44e0 ("liveupdate: luo_file: implement file systems callbacks") > Signed-off-by: Pratyush Yadav (Google) Reviewed-by: Mike Rapoport (Microsoft) > --- > kernel/liveupdate/luo_file.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/kernel/liveupdate/luo_file.c b/kernel/liveupdate/luo_file.c > index a32a777f6df8..9f7283379ebc 100644 > --- a/kernel/liveupdate/luo_file.c > +++ b/kernel/liveupdate/luo_file.c > @@ -402,8 +402,6 @@ static void luo_file_unfreeze_one(struct luo_file_set *file_set, > > luo_file->fh->ops->unfreeze(&args); > } > - > - luo_file->serialized_data = 0; > } > > static void __luo_file_unfreeze(struct luo_file_set *file_set, > -- > 2.52.0.457.g6b5491de43-goog > -- Sincerely yours, Mike.