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 395033BB48 for ; Sat, 21 Mar 2026 01:23:52 +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=1774056233; cv=none; b=GwZ/YhylgHI7bJqvB51jVFJHgaV6pLb8QRsrA3gr/mW4v9i+af8/UAyOa76454SKhTfeVqgZ8Z6O0YNJfJVPThyWSmubWdX2nPKpYvqfGYdRkd1nqVcyVHUlgdg7w4mog/7r2wobNLm/VU4vJf7rBjzN4Dt1KwbCyfjf9xNVBm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774056233; c=relaxed/simple; bh=rnrB+r9upjuRc+mL3xjhUHiIFwtv9f3pu+ODqRoiEwk=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=V83t6KPhVqWpHp462pabMMp1J9KMIyRGI2Ex8nR/ujMmLT/DEL9l7EmMAnoFwNCfiorO6cFDOWXdpc8w7XHWVYt9U9tPf15RWw2u4FK8eA7tbshFjr0fR6Y3N+LmJ0PbKKJ5XCuW/SP1PPTWibjIHKpiBeW87LN4HcjvQvZCRgM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=KYI1iLRk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="KYI1iLRk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EF70C4CEF7; Sat, 21 Mar 2026 01:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1774056232; bh=rnrB+r9upjuRc+mL3xjhUHiIFwtv9f3pu+ODqRoiEwk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KYI1iLRkjpOcMtcGWhWI/CIiVv3M0XEkmgOw+PNHtt+ULqlxzMo4WftpXVrrKPtYj FqeLjp7rFmN+uPb6hqwOrQL5pzJpVL9JO9Qf48H1JHtkM31dPeMvjRqReZmBRp50jx CgIIj80gZKOAnJnSwrCytPR64i6NrAp4ucIDozrE= Date: Fri, 20 Mar 2026 18:23:52 -0700 From: Andrew Morton To: Oskar Gerlicz Kowalczuk Cc: Pasha Tatashin , Mike Rapoport , Baoquan He , Pratyush Yadav , linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH 1/5] liveupdate: block outgoing session updates during reboot Message-Id: <20260320182352.ca6c88e409ff12d0368b03ae@linux-foundation.org> In-Reply-To: <20260320163720.100456-1-oskar@gerlicz.space> References: <20260320163720.100456-1-oskar@gerlicz.space> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Fri, 20 Mar 2026 17:37:16 +0100 Oskar Gerlicz Kowalczuk wrote: > When kernel_kexec() starts a live update handover, LUO serializes > outgoing sessions before the reboot path freezes tasks or shuts > devices down. That leaves a window where close() and > LIVEUPDATE_SESSION_PRESERVE_FD can still mutate an existing outgoing > session after luo_session_serialize() has already captured it. > > The race is dangerous because the next kernel may inherit stale file > metadata or references to memory that userspace has already > unpreserved. That breaks handover consistency and can later trigger > restore failures on already torn down state. > > Mark the outgoing session set as rebooting while serialization is in > progress, reject new mutations with -EBUSY, and make release wait > until rebooting finishes before unpreserving files. Reset the flag and > wake waiters when serialization rolls back, and use READ_ONCE() and > WRITE_ONCE() so the state is visible across CPUs. Sashiko AI review has quite a few questions: https://sashiko.dev/#/patchset/20260320163720.100456-1-oskar@gerlicz.space