From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B926430CF8 for ; Thu, 16 Jul 2026 14:40:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784212834; cv=none; b=gDyrwFUjz769GfkA3131IxcK37ZEi9/h7KYfzvDyoTUZhG2OUeSlAsjBoEPqOFoydwVQ2oEEYSr3lDkJ5Wu2tOQnMSQ1Hw50gKKI3BBj6hv+X7Fxs9zIxsGpQWOJPGE6VppzsSaKtlRU9RLqUhhoOs8Oog3Z3FlscvcIveKnP2o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784212834; c=relaxed/simple; bh=Hpdg4JBAxOj+PU+ZMsPgiOD+dHGCLzSNL8/fu/+bZ2c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tFBeBysI1ZV0GgZGvmH+pNkMBdcGtNFICY5tnq/f7faLSWHRDC3P8NYC/VGgjqxCN1mIurTbDydCxun055XVleZugyr/Dum9MoyCnv/I/zNU9BlXiGbi80ZVY4w1qZn/eKkaJ3oEhV04UHNRWVTVrex3SAlYtU4ehFPZinzFtCU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=UzDxVw4r; arc=none smtp.client-ip=209.85.128.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="UzDxVw4r" Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-81e86df8987so6566777b3.3 for ; Thu, 16 Jul 2026 07:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1784212832; x=1784817632; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=9Hq7mqdQ2orEVSVK+XIkt+n7imo/sMvdXL9WaKcDjY4=; b=UzDxVw4r37gRy6e7Ns4i/TyrGCapM60g5HKvfgp7KfcrO/cwkB49OUvI4pdsLoFdEJ WwPtvfLfy+Xy/iYv0HZ1192pEFnh9VzXCO7VVxUbb0dJ6xSYzYSZnN9Sml1VLJysy/T0 r2usg+roiujC/rBpn5y7CGe+8msr+O0lNPcFbrp9I4a27kjPYNYPsoZKLQxCdGGnahLp 5s4LVOCzr/EYhXP94pPcy7AaUX/UkOmjjF5HAKnUadd8fC+OYOkgad6a6p5BgRUDTQVv 0H9Qlxa9X7OHs87uwwVuot6dIk/kBh0XsUGEXTaZRA7rS2xqHZr5yIsPUZyngOa20g4R TDkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784212832; x=1784817632; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9Hq7mqdQ2orEVSVK+XIkt+n7imo/sMvdXL9WaKcDjY4=; b=h2IykPFiwubKNswq9kMcuoX647mi9SElS705NBLm9M4MQM6lFBMUkbGDReU8P6iI6t W/IkkPw1Qlni3FJTB1EtpcgC+3o0vQMcl7TlhPkbdcw3vegK+eiZTtIIz58kG1XYu/wv naYgIKRm8K5lB9l2PpgxrsiX5jRRnppBAZO73QeL5PDunr38kv8dYdeimcz5/j2ld91J 2O79dmTCfmYuJ02T8sumUInygBUQVy2F4N4ClDhIVWS4oZqTsY0CXy5+ogYj/Dvok2aR Q8475+4bVIoUr4zB8CHfrfU3/8MnOieDbQInF1DNChRqoNZt8JmXHqKUyyK0T8cPhpJo 9vkw== X-Forwarded-Encrypted: i=1; AHgh+RpiKj+P0eu1dEQM+9xttzQ0OLNMb+0K9q49yAWoJjIRnT8egpAOrpL9OdpdLGUGTyd7cip7tsxFNPi47Vs=@vger.kernel.org X-Gm-Message-State: AOJu0YwiB6wuv+DrvNCOw9Wa2WxkUw+LA+ZRVAXQr4lxDuEuK74kI3q7 HcOEIz+PHl5uymnwFbnh7RFwB9lr0ZaAOfEVAkd3EHs6lmszmRi6ynAVEJQemnphkmg= X-Gm-Gg: AfdE7cl8cQ2cG1Qjc70CYIXDXWT8Za57EFfPNpjhZoZKpreS/Dx4ALjmgRdVWYASgjz o6CI1V03nvC+8A2fvJlkDEsigc8xrxsDunx0UT7aWkfZfysAXOGvrNitGO/nnGxw67FpIl138ly kZRFaE8/skg3491JNFnjg9h1S3fRVpY8loPtGVn0ixwkNGeMtz1qrxnWvRkhNhqcYZXo85ytgHB UHVz0/gbxwcjkDZN0VQNrEfAWVE2XW4PjinJA9eMXe4WzSh2YVyxx7BXPKMg8E6s6wBXumwZNJG o320fblLuKxyj55HNp4bE5OerX1zB+3ki4+KsFOiEokBh0k+qTuBq83Xbn48ZZrNQCg/IKhNT0a gmwemqaL135cqbSaAzuO9NAP7IM1Zud/ZG9HFvsrCydHm+q+0+CaHZiBribN5H045XZPEegNg8W XkJU/A4Gup7uBxIOaNYotINZ+cluGLq6Avw3GsGgV05fM+KwtOsQjYRpnEWxbbKGKAMLwzP9+gc vrBtiM1G7A4fmA926F1MUU= X-Received: by 2002:a05:690c:4b13:b0:81d:6eec:fe22 with SMTP id 00721157ae682-81ecfa0f945mr56355607b3.44.1784212831974; Thu, 16 Jul 2026 07:40:31 -0700 (PDT) Received: from google.com (138.200.150.34.bc.googleusercontent.com. [34.150.200.138]) by smtp.gmail.com with ESMTPSA id 00721157ae682-81ec99280e3sm58348947b3.12.2026.07.16.07.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2026 07:40:31 -0700 (PDT) Date: Thu, 16 Jul 2026 10:40:30 -0400 From: Pasha Tatashin To: Jason Gunthorpe Cc: Pratyush Yadav , David Matlack , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Mike Rapoport , Pasha Tatashin , Samiullah Khawaja , Shuah Khan , luca.boccassi@gmail.com Subject: Re: [RFC PATCH] liveupdate: Allow multiple openers for /dev/liveupdate Message-ID: References: <20260714190356.190328-1-dmatlack@google.com> <2vxzy0fcicpi.fsf@kernel.org> <20260715172336.GC3775915@nvidia.com> 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: <20260715172336.GC3775915@nvidia.com> On 07-15 14:23, Jason Gunthorpe wrote: > On Wed, Jul 15, 2026 at 03:50:33PM +0200, Pratyush Yadav wrote: > > Hi David, > > > > On Tue, Jul 14 2026, David Matlack wrote: > > > > > Remove the single-opener restriction for /dev/liveupdate by removing the > > > atomic in_use tracking and the exclusive open check in luo_open() that > > > returned -EBUSY. Protect luo_session_deserialize() with a mutex guard so > > > that concurrent open attempts by multiple processes safely executes > > > deserialization only once. Update liveupdate selftest to verify that > > > multiple concurrent openers succeed. > > > > > > LUO does not inherently require a single opener. There is some > > > documentation about it simplifying state management, but the only thing > > > it actually protects is the session deserialization during first open, > > > which can be easily handled with a mutex. > > > > > > Relaxing the single-opener requirement avoids the kernel forcing a > > > design pattern on userspace that it itself does not require, e.g. > > > allowing multiple userspace processes to create and manage sessions. > > > > Agreed. When the kernel had a global state machine in the early versions > > of LUO, this might have been more relevant. With sessions, even if we > > later add a state machine, it likely will be per-session instead of > > being global. So I think letting userspace open /dev/liveupdate multiple > > times makes a lot of sense. > > > > Also, today's systemd only supports preserving individual files, and > > does not hand out sessions. To get sessions, userspace must open It should in the future, because of permissions issue, see below. > > /dev/liveupdate and create a session. This opens up room for one bad > > process to block every other process from creating sessions. It also > > imposes a need for userspace to add a polling/retry logic for getting > > sessions and serializes their execution around this point. > > Shouldn't systemd open and own /dev/liveupdate? That was at least what > I originally expected here, you'd talk to it and get a session FD > through dbus. > > Moving to multi-opening /dev/liveupdate and removing visibility of > what sessions are open from systemd is a different model > > Not saying this patch is wrong or anything, but that I don't really > understand what kind of model you are going for now. CC Luca for systemd's take. /dev/liveupdate should only be accessed by a privileged process, and sessions should be accessed by whoever originally created them. While this patch does not change the permissions, it paves the road for us to move in the wrong direction: instead of having a privileged userspace manager that distributes the sessions to their rightful owners, it encourages userspace to work around the permissions so that VMMs access /dev/liveupdate to retrieve or store their sessions directly. This would also allow them to access sessions belonging to any other participant of the live update. Instead, sessions should be created and retrieved by a privileged process that knows to send them back to their rightful owner after retrieval. Also, as a minor concern, each userspace LUO manager needs its own session to maintain state. This means that by allowing multiple managers, they may run into naming conflicts for those state sessions. Pasha > > Jason