From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (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 7A5502F3C0E for ; Sun, 17 May 2026 19:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779044491; cv=none; b=V7kTtg1B9uEAJFQ+Et743IYS7AL9KBJ5aU/hsUUrV4MbRB7vSV7x3Sqwjvi8RG2cXbvKuAOsAIaG2vF5jhplc53+X1+3w6HSsA4ltlJpcn0ICtE+F3CUpkVEW+eOd7bG6Ux2iHuy5DCn0SyV8bo0hVcT4EexY/lOHBpQwKcPPac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779044491; c=relaxed/simple; bh=tvNR3VRmthJskV0PtVqI8bDa1Keej4g/0+/+groPWyA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DiFyKh8ZxH43tL9kfOSSdN/7fmYfl3zkF+mRBRDyx02Q8D+2kNSLPLBdWD82UzJmByFQ24QIhxaG0Tftdg0yTW/8uqHH47ZiN743qmVOBTN8qt4qImbTcqJ2qtGxLFv61zlN0th3H0AUHKpXNMpPnynmlKtTmNLAkql9ClYOQHo= 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=X06abiB5; arc=none smtp.client-ip=209.85.219.42 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="X06abiB5" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-899a5db525cso8680356d6.3 for ; Sun, 17 May 2026 12:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1779044489; x=1779649289; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BHqthI1CDxGfCxTi7gsLzzy1qcENONWCFt/VwaPCNVg=; b=X06abiB53rceixXux9ygKsCkrOkaT+paVf08WcLMTsep/QyOsbjBuczgPjjaI/XQgq voY/kqcMgDEKQbmqWI3T+750iXXzO4HWRoSlWluh/L/SLG6ut+qSeRA1KvFq1Vbqdm4R avOcXU5yPyF/aIBbfixNOHEL4DEE6E9SrjEB/KYrT5lDKuMjHXQsSGAtipPk0qKiZ/JS g16g+Hx/U3xcNmHUjwHm/zKb3VV/MegTMfxOja58QBwAWDQfZw+0nnxp1Ty2P89lvivZ 81w9B1/ralSYJjmPZF9DTxk+Exr8KxNn5jVW0f83vYHltUL26Ay96iT6rASDDlhNpkLH n9JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779044489; x=1779649289; h=in-reply-to:content-disposition: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; bh=BHqthI1CDxGfCxTi7gsLzzy1qcENONWCFt/VwaPCNVg=; b=T8h/Z8kMZ6KflBbFiYuR8fzAd06/fZIr28OaFfsYAYv4pRrkEZvDsC1QV3PYiEXGqY 299TXB7JNZb30M4zFd25UfOPoJAYsmuoO/P2ipct/gBBPG4ZELLpOvgOJcovP+kW7OCr mj8eXndSGtW5djwSGO3ni3E35mm2fVXbMbcw4BC1IiUFTEbmvOYYQofK7giKJVNaqmyy +9Aket1hOG8yCCknr4e/1bV7oJfW21IT5qk4AJks9Ms6HHwQEsYwSaxwou1n3Yt3JEvt KEwp8WPU3BNSh4zK2nT708U1yEjHFGqzdFtePCSfgu1cg0NGIqF7C0S3+vAJFoR9PLPo iSnA== X-Forwarded-Encrypted: i=1; AFNElJ9x7QqGioB70W8TUOXcojinw6m5x7ySau0hdBjpdbinuPtRQMmV5yl9n7KQNXx7XnQed8XbrTu9uychoak=@vger.kernel.org X-Gm-Message-State: AOJu0YxijvL7fMA+ImV/02xoXTBorDCjawOe/4NHqDgXf3Y3XT3IILH1 /iscEPZK/ek/VnskCNo07Xf5mtefTIiXXyuFzPMrFW7Ylqie5Z3vl6dMj0cWywowtVs= X-Gm-Gg: Acq92OGkGO1Bam2Ql2rEyBCkH0TTRySwT41OaO0oP6GdaMstskc14NO8sKJIybhWbEE yS/d0kdTB6/rVi3y4ipNUeXP7/Ce1ehV0t11/cdXCvgYKDg08BCihZcdg4AqSHUFSTSHGaCB0V0 jJp6V2n+0aNEZQFVNGZbc9hM2/S0noaI6v2Ake4s0rQg2958DjHU6/e7BDJRlNWmmzT6+iVIPPl 2/MnNeIX/sTYW52pJIHCb428Dd7bWz02/YoeGGgBOyE9UfSmO8+1YmGzv7/7IGFATT0XYmPmDPY eYnFwF8V6tZoZ9nNVVZcDB3MaWy0fHSnoS6U76OvtNzgciTBFekd8TAex0fWhDL2NqLZEOeCVDO Stwzz2rYc4nM7vDqblR3WDBFIOSeBQB/nv2l7OKicVdoDvx3fr5dI1rWSYZYFsxWAJBYojIcegp ifA2k86NrhF3epAhAysxtPgIeAV7pKLnK0IN2fh+Kv+neY2qvdSIE= X-Received: by 2002:a05:6214:2b93:b0:8ca:16a6:3d60 with SMTP id 6a1803df08f44-8ca16a64337mr155957446d6.17.1779044489207; Sun, 17 May 2026 12:01:29 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8ca361ad694sm29945406d6.45.2026.05.17.12.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2026 12:01:28 -0700 (PDT) Date: Sun, 17 May 2026 19:01:27 +0000 From: Pasha Tatashin To: Mike Rapoport Cc: Pasha Tatashin , kees@kernel.org, sourabhjain@linux.ibm.com, jbouron@amazon.com, akpm@linux-foundation.org, bhe@redhat.com, linux-kernel@vger.kernel.org, dan.carpenter@linaro.org, rafael.j.wysocki@intel.com, piliu@redhat.com, kexec@lists.infradead.org, pratyush@kernel.org, skhawaja@google.com, graf@amazon.com, mario.limonciello@amd.com Subject: Re: [PATCH v3 0/5] liveupdate: serialization safety and race fixes Message-ID: References: <20260515003722.938123-1-pasha.tatashin@soleen.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: On 05-17 20:43, Mike Rapoport wrote: > On Fri, May 15, 2026 at 12:37:17AM +0000, Pasha Tatashin wrote: > > This series addresses several issues related to the synchronization > > between the reboot process and LUO session management. > > > > Changes in v3: > > - Refined the session mutation blocking to use a dedicated global > > rwsem (luo_session_serialize_rwsem) instead of pinning individual > > mutexes. > > - Fixed a use-after-free race in luo_file_unpreserve_files() where > > a module could be released before its file handler ID was erased. > > - Fixed a TOCTOU race in luo_session_retrieve() by extending the > > lock scope to overlap with session mutex acquisition. > > - Removed an unused 'ser' field from struct luo_session. > > - Dropped the KHO skip patch as it was not needed. > > > > 1. Skip LUO serialization for context-preserving kexec: A > > preserve_context kexec returns to the current kernel, which is unrelated > > to live update where state is passed to the next kernel. Skipping > > serialization avoids unnecessary work and prevents sessions from being > > left in a frozen state upon return. > > > > 2. Block session mutations during reboot: During the reboot() syscall, > > user processes may still be running concurrently and attempting to > > mutate sessions. To prevent this, we introduce luo_session_serialize_rwsem. > > All mutation operations (create, retrieve, release, ioctl) hold the > > read lock. The serialization process holds the write lock indefinitely > > on success, effectively freezing the subsystem. > > > > 3. Fix use-after-free in luo_file_unpreserve_files(): Reorder module_put() > > to ensure the file handler module remains pinned while its operations > > are being accessed during cleanup. > > > > 4. Fix TOCTOU race in luo_session_retrieve(): Extend the rwsem lock > > scope to prevent a session from being released between lookup and > > mutex acquisition. > > > > 5. Remove unused ser field from struct luo_session: Clean up the > > session structure by removing a field that was never utilized. > > Sashiko is still unhappy: > https://sashiko.dev/#/patchset/20260515003722.938123-1-pasha.tatashin@soleen.com > > Didn't verify it's actually right, but its complaints seem legit. Reviewed the complaints, a couple things are legit, I will address them and respin. > Among other things sashiko noted a TOCTOU issue and then found it's fixed > by a later patch, maybe move the TOCTOU fix earlier in the series? Sure, will move it earlier, while I think, as long as it is fixed in ther series it does not matter where it is :-) Pasha