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 3FE6E40DFB2 for ; Sat, 21 Mar 2026 17:45:22 +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=1774115122; cv=none; b=KVTpaNqOlRR1I6JvEzJNOpCUXUlnvbCYYe2oTbJqHcU/1MX6yUv6IpK1Gq9OiYvajPMMQCIoZokbmVyAryGbj6SM99/K3URmtvjIQ0UM9xr1TqoSqLTMNYqnR59NWOBZF076WLogNBTjcFPY+vf0IRNVNEF1sPD27xMnDls8KO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774115122; c=relaxed/simple; bh=b09dUEiuJZvqLTVdlTgn9/rX1kYJB0cx3MYC05H7O18=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=OzI89z0vgjEsENElFWG8ZoeO2R7ah2rehrtqFw1/izDI8kE+yG3KvfoySLA52C+En+kcfvcV09fCh/kpupYjPQNDLgUsaMzj69sMbtFTKluXZc8WBocHvZU0KokgpvKC2e5WzofoxqDbH2QQxv1oRkj3adNHdbNkt4vkODHR3x8= 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=2eggLpm4; 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="2eggLpm4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7C5FC19421; Sat, 21 Mar 2026 17:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1774115122; bh=b09dUEiuJZvqLTVdlTgn9/rX1kYJB0cx3MYC05H7O18=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=2eggLpm4YaEuXpxVeTrzh145/QggoL5VcJ7Mksr7anH6AU6oQX0s99X2FXLqL58iX om12fFB7CnTxAzjmTikgUovArDr5gHs8ArW0BHReXqh7H0hse4uptdNR37FXj6kwup UIXvqEdSPhk4fynERqS/2ahjE8n5unx08ZJOahZo= Date: Sat, 21 Mar 2026 10:45:20 -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 v3 1/5] liveupdate: block outgoing session updates during reboot Message-Id: <20260321104520.5e9aa4768df0520d7d6588f4@linux-foundation.org> In-Reply-To: <20260321143642.166313-1-oskar@gerlicz.space> References: <20260321143642.166313-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 Sat, 21 Mar 2026 15:36:38 +0100 Oskar Gerlicz Kowalczuk wrote: > kernel_kexec() serializes outgoing sessions before the reboot path > freezes tasks, so close() and session ioctls can still mutate a > session while handover state is being prepared. The original v2 code > also let incoming lookups keep a bare session pointer after dropping > the list lock. > > That leaves two correctness problems in the reboot path: outgoing state > can change after serialization starts, and incoming sessions can be > freed while another thread still holds a pointer to them. > > Add refcounted session lifetime management, track in-flight outgoing > close() paths with an atomic closing counter, and make serialization > wait for closing to drain before setting rebooting. Reject phase-invalid > ioctls, keep incoming release on a common cleanup path, and make the > release wait freezable without spinning. A [0/N] cover letter would be appropriate. Please have a think about which patches should be backported into -stable kernels. Possibly "none", given how new LUO is. If there are any backportable patches, please ensure that they are at the start-of-series, or separate them out into a separate series, against current mainline. AI review hasn't completed yet, but it has things to say: https://sashiko.dev/#/patchset/20260321143642.166313-1-oskar@gerlicz.space