From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from toronto-edge.smtp.mymangomail.com (toronto-edge.smtp.mymangomail.com [209.38.81.170]) (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 6C5903033F7 for ; Tue, 24 Mar 2026 21:29:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.38.81.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774387765; cv=none; b=tk0B1HRyMcyL2lEEU9eIfISl0gJbVAniy10lfR6pXkLCIlhLQBFJGvu4tXDX5TC99Xw6tMSvCEOMiYJpIeNvqpRQDsrMRkOeuCSrooU6ieWnuIztabLSv9NlSueaXJD7bUBEIx8Jya15D2oal5Ff3SztLaPMoLfzFynLTJxFY9s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774387765; c=relaxed/simple; bh=U3g2cJ4i0kfU7fAPqpRnGVtuJyqHXzzYfGdEhgmkup8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OMflMrzkYbcL4yG0wzkBG/RkTBDzdRyE+6WDhBnkop8YJHI6Zhe1QRmsjjFz1Vep2kI+Tb3NgTkGDkwtPOcZNSNiMfUScNl4n/qJigR3bA8eiXzus/cD9ooyD5n8I04uPaWoCcIszkaDpojFQwnNG9qV05I7+cnmG5nl3V9Po/Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gerlicz.space; spf=pass smtp.mailfrom=gerlicz.space; dkim=pass (1024-bit key) header.d=gerlicz.space header.i=@gerlicz.space header.b=c4hrJpkF; arc=none smtp.client-ip=209.38.81.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gerlicz.space Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gerlicz.space Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=gerlicz.space header.i=@gerlicz.space header.b="c4hrJpkF" Received: from [127.0.1.1] (localhost [127.0.0.1]) by las-vegas.smtp.mymangomail.com (Mango Mail) with ESMTP id BE441418CA; Tue, 24 Mar 2026 17:28:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gerlicz.space; s=mango-1; t=1774387733; bh=U3g2cJ4i0kfU7fAPqpRnGVtuJyqHXzzYfGdEhgmkup8=; h=From:To:Cc:Subject:Date:From; b=c4hrJpkFB8lQJsNFKNROacA0nVLwxVgniVWlIQsJb8Wld5lCwcvt5xGlCqc4DKYkZ NfujZ/Rz+GIGS/5fdF8afxfDWbtWAc2q1mTRl7WQnmmucn/qy+P09LaJG/AduDKiq1 pjKOnrI7O70gNdDXDQTZeydb9+xQQN9PvmpFnlmg= X-Mango-Origin: 1 X-Mango-Origin: 1 X-Mango-Origin: 1 X-Mango-Origin: 1 X-Mango-Origin: 1 X-Mango-Origin: 1 X-Mango-Origin: 1 X-Mango-Origin: 1 X-Mango-Origin: 1 Received: from authenticated-user (smtp.mymangomail.com [205.185.121.143]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by las-vegas.smtp.mymangomail.com (Mango Mail) with ESMTPSA id 7FFAC41694; Tue, 24 Mar 2026 17:27:36 -0400 (EDT) From: Oskar Gerlicz Kowalczuk To: Pasha Tatashin , Mike Rapoport , Baoquan He Cc: Pratyush Yadav , Andrew Morton , linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org, Oskar Gerlicz Kowalczuk Subject: [PATCH v4 0/5] liveupdate: tighten handover cleanup and session lifetime Date: Tue, 24 Mar 2026 22:27:25 +0100 Message-ID: <20260324212730.65290-1-oskar@gerlicz.space> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Pasha, this v4 keeps the simpler direction from your mail: outgoing handover is still driven by a boolean rebooting gate, refcount pinning of outgoing sessions during serialization, and session->mutex as the serialization point for in-flight mutations. There is no return to the earlier closing counter or a larger session state machine. The main changes in this respin are: - reshape the series into five commits, each building and standing on its own - keep incoming session origin immutable and use retrieved only as the checked-out bit - make FINISH and implicit close consume incoming sessions without reopening races through retrieve-by-name - route deserialize failures through explicit rollback paths for sessions, files, and serialized memfd state - validate KHO-preserved extents before walking serialized metadata - harden incoming FLB lifetime and remaining teardown paths Patches 1-4 keep the core session, kexec, deserialize and validation work separate. Patch 5 carries the remaining FLB and teardown fixes needed to match the final tree. Oskar Gerlicz Kowalczuk (5): liveupdate: block outgoing session updates during reboot kexec: abort liveupdate handover on kernel_kexec() unwind liveupdate: fail session restore on file deserialization errors liveupdate: validate handover metadata before using it liveupdate: harden FLB lifetime and remaining teardown paths include/linux/kexec_handover.h | 13 + include/linux/liveupdate.h | 17 +- kernel/kexec_core.c | 4 + kernel/liveupdate/kexec_handover.c | 22 ++ kernel/liveupdate/luo_core.c | 16 +- kernel/liveupdate/luo_file.c | 237 ++++++++++++-- kernel/liveupdate/luo_flb.c | 116 +++++-- kernel/liveupdate/luo_internal.h | 14 +- kernel/liveupdate/luo_session.c | 500 ++++++++++++++++++++++++----- lib/tests/liveupdate.c | 2 + mm/memfd_luo.c | 160 +++++++-- 11 files changed, 934 insertions(+), 167 deletions(-) -- 2.53.0