From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD026606A31F for ; Thu, 22 Oct 2026 15:26:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Wiii2L1t; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CKA3U7yH DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Date: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Cc:To:Subject: From:Message-ID:MIME-Version:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=6Rk57VYTFxT03jZ1TU9JTKNXgFQgGwNWI0mcFNI4uHA=; b=Wiii2L1t5xvSAm40SXgmwDdnim lpi91t2VrZgsHES2xdFBG0t4IA1UaGUfbcb/NXgTVQPSHqL5vTevHPj57I32FnV4X1MWYW/2POrBq bg369knkzSaMv9AjUqe/IbFzAuQmVzqNswLhAQwzgeNMpJvh6DoNH9xg44VddWDCQyHDCG5jifuIf hZ7//Hcb0TlHNWisRS6tbozSxz0+qc4yguWGOshZMno8l7k0+PIkAUpO9YEfoOSrpohPgSSustbcj heQzbM0R22O4+I4Nkcy2OwC5CnH616thneXRY+YB1Ne8661osbQJJcdZ+ps1VH7Q6jpbgAKcDbzQH bb5yuULg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xJugV-0000000EPE6-2cVs; Thu, 22 Oct 2026 15:26:27 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xJugO-0000000EPDA-0o30 for kexec@lists.infradead.org; Thu, 22 Oct 2026 15:26:25 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 51BDB609CE; Thu, 22 Oct 2026 15:26:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86D791F01828; Thu, 22 Oct 2026 15:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792682779; bh=6Rk57VYTFxT03jZ1TU9JTKNXgFQgGwNWI0mcFNI4uHA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=CKA3U7yHNsTFIx6kxEcLs5OVD6ebzdFWhoFXr7DmBsKSb2QUd3vo/GIteWTSYsEQ/ w3+ARt1X0Uh/Zu5ldqjZNAd590d4rnr3/kyJ+l8jCow2ffWkBAS9SqI2SAeOOkLdpS IdhEfuMtoz0jCg/aZAvoditD9cY5Bz6pKOISnHK67YOLFtYCIjeoEHHLaD5Az2i1xp 7zX6+DLoI5BJ+em8rg2MqNGiiMBFV7zhaTpk9BgWZsl7AO9hYrMK/h30etinAiZAVh 4/AF/FY7X10Q16ItM5b5o6+9v6qCIsp+JkQ79yx5VXQg7cyj6j7fLd8Ww2Q+l9IQXs R4FG2BKvcTc/A== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH v2 2/4] liveupdate: Select file handler by name in the preserve ioctl To: "Tarun Sahu" , "Andrew Morton" , joro@8bytes.org, "Mike Rapoport" , "Pratyush Yadav" , maz@kernel.org, arnd@arndb.de, "David Matlack" , jgg@nvidia.com, robin.murphy@arm.com, loganodell@google.com, oupton@kernel.org, kevin.tian@intel.com, alex@shazbot.org, dwmw2@infradead.org, pbonzini@redhat.com, seanjc@google.com, will@kernel.org, "Pasha Tatashin" , "Alexander Graf" , "Bjorn Helgaas" , baolu.lu@linux.intel.com Cc: sagis@google.com, linux-pci@vger.kernel.org, kexec@lists.infradead.org, skhawaja@google.com In-Reply-To: <20261021152527.375070-3-tarunsahu@google.com> References: <20261021152527.375070-1-tarunsahu@google.com> <20261021152527.375070-3-tarunsahu@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 22 Oct 2026 15:26:17 +0000 X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "kexec" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: > Currently luo_preserve_file() iterates over luo_file_handler_list and > picks the first registered handler whose .can_preserve() callback > returns true. When a subsystem introduces a new, backwards-incompatible > file handler alongside an existing one for the same file type, userspace > has no way to choose which handler preserves a file descriptor, nor can > the kernel keep the existing rollback-safe handler as the default while > allowing callers to opt into the new handler. >=20 > Append char handler[LIVEUPDATE_HNDL_NAME_LENGTH] to struct > liveupdate_session_preserve_fd immediately after token, keeping > IOCTL_OP min_size at offsetofend(..., token) so callers passing the > original 16-byte structure continue to work: > - When handler is empty (all-zero, or zero-filled when userspace > passes the 16-byte structure), luo_preserve_file() selects the first > registered handler whose .can_preserve() callback accepts the fd. > - When handler is non-empty, it must be null-terminated within > LIVEUPDATE_HNDL_NAME_LENGTH bytes (returning -EINVAL otherwise); > luo_preserve_file() looks up the registered handler with that exact > name (returning -ENOENT if unknown) and verifies that its > .can_preserve() callback accepts the fd (returning -EINVAL if not). >=20 > The retrieve ioctl is unchanged because the handler is identified by the > name stored in the serialized payload from the source kernel. >=20 > Signed-off-by: Tarun Sahu Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261021152527.3750= 70-1-tarunsahu@google.com?part=3D2