From nobody Sat May 30 19:21:54 2026 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (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 058913BF684 for ; Wed, 27 May 2026 20:27:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779913664; cv=none; b=MoEosVD9X2i7RIBAwIaa3pPIHXSE5Ja4DmTNJ51pJ5Gbq2itAmwPLHLdGH7NvcMjjpOjKli5EfOTMcOmdvxko87MpYq9urMNGwQMSTru3joJ6p/6rprGpJFyEajzP/P8WXR9MC5WLoqewtJ3v/BHpO4BNhFwVQlL7SiYgJ2sf/A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779913664; c=relaxed/simple; bh=ThOZWVeSbIjBKd+GRVf3JGXkhhtQKRBs98xF6IKP0Pc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U6BDugAmxAEdQ7/CXsUa2t/REkylGSQQ2ZXR4/IGoGUx4MKLV3VztzKJELskeHTUKBiLftpBOVJqtnikVCzPlKwN1djX83IAz8pjHcZeIpN1j3bXN2oqVYZCTr4MdfuanQh2Nzda6B60F2MIgjj5oyepm/U2drU9aHJLMiWMg+Y= 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=YbXd3gbv; arc=none smtp.client-ip=209.85.222.178 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="YbXd3gbv" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-914a90b69a3so689543485a.3 for ; Wed, 27 May 2026 13:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1779913662; x=1780518462; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=HZBWzBJ7tcP2BdZJjyaMfbgUmI299X9kvwn5AEgOwKY=; b=YbXd3gbvd8GWBoa6Ve8Kn8qZ+Laj2fcLe227JDNyhU8HehK/sQuFu+ARqoTagQb1Ir HXnwOLV2vo1nVgV8+XjENLrVUxz++IDQK8Ee3AlEQaYlGzbtwFR41o+Zwz/oiSmYahtd Q4VT8DYKVs0csIc7kXJHsb++IRihah0gdIApt2y5OI64gCBX7o2ZilL19R2kBaQbY7fQ HSTZR3zo7sR1xtUvwd+dqS6s2U2K2eClII43KohhBjZXnAm94LdX1wacZ08aLx0ZUWhM uxeiM9hP3pzWqBl+sr5P/f0Lo8wevZjqtLkolg4mGFhRRiVg1YYSpdcuRgIAYz0ngolu LOmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779913662; x=1780518462; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=HZBWzBJ7tcP2BdZJjyaMfbgUmI299X9kvwn5AEgOwKY=; b=TcjTadPiaos/sys0NJSwPYrXkx8EJ+6/pVdLU/a/Of1xep6M2q23mhFYzSM9bbk7cL SbhRG254Ie2wdFpsxSU22umdZcPmKE2HlPZpqtIBc6BUG2f9JbdTzCRHHowlljuJPxzI qhd7MgP2nNsuOUJmPO3ihOJSS7dCMfFNsAfqKe6E+K6318crWiwuxw4jhNZh+bDP5twG hrOlPiGczc2/Y/Vpv7lyOK6n768CcP8cx3MoBSeLsTWoat7QbiXZ0sIUu/UQgCg6Aqho ClHv6M3tefZoI3frqAZOxxpKmcqcAtjKb3KZFOw5Rj00mFaXtoddwUi3k4IABK5bB7rk EMww== X-Forwarded-Encrypted: i=1; AFNElJ/IVxuyywC4aLpmpQKFD03GCL3mcj/qxYHmjrwUwM4wdlEes84dac1MkGDkUkeU1RhJ2fFKzRG2zQ6wD1E=@vger.kernel.org X-Gm-Message-State: AOJu0Ywjn2jzO2IBVyrxw8wzR4SSWaimLLjSLa+hTKKBGrdJZQ8bN/PY y7sGfqGASoNjUVvuG5PiHC108QbZ8arvKxS0DyEMgxlblLWdKkXJJeR7ZqIZJiol5gg= X-Gm-Gg: Acq92OFvDjHkdJx/sVXRV7gxVHs4+TstUwd9fV2TjCvpZttPv4455z3NYKDp83kIxDI DskQl85zleqJlIigDvLx3dsN/XhBrGAQZWHCAvmeYBzsAzqRmV0IRcokSUZf0r+4gHVfcNrZYRa dcMTgzKScqjzLnOGlKJDitwZXJgzTATYuDSFkWc7caf8qJBeJZKU3aFVPoikmrD8zjcaKpMDKKT RE4LiLWr9HQrP9TSRKuipXLoXGuN5FNQcu/Pl5dUXVbfjWu69Q3b4RMl4wrzTYonGjmuqOCr9iO s+CXxl2OTam9BtMnPy3cBnsXiiHJt+9e9D5EovJZtsROczSbVByqhoVQX3lQOfaaY31KD2fgcyh ymP7Q1YBJfLQ0AecjbAERQouT4s3MMqNslCUYJaou8+lDETA91/77XmWlGxV5fJme7SjM0fWbae 61uVj5Ag3ojpEFlnM5dYe7A9WBrLsAOhiNsRH5ZA+PauUVYC+JHoQIYZgPvKFO9w== X-Received: by 2002:ac8:5ccc:0:b0:50e:a1ab:67ea with SMTP id d75a77b69052e-516d4603cb6mr334534721cf.40.1779913661780; Wed, 27 May 2026 13:27:41 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-517069ecb93sm58632971cf.4.2026.05.27.13.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 13:27:41 -0700 (PDT) From: Pasha Tatashin To: rppt@kernel.org, sourabhjain@linux.ibm.com, jbouron@amazon.com, akpm@linux-foundation.org, error27@gmail.com, bhe@redhat.com, linux-kernel@vger.kernel.org, pasha.tatashin@soleen.com, 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: [PATCH v6 1/5] liveupdate: skip serialization for context-preserving kexec Date: Wed, 27 May 2026 20:27:33 +0000 Message-ID: <20260527202737.1345192-2-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260527202737.1345192-1-pasha.tatashin@soleen.com> References: <20260527202737.1345192-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" A preserve_context kexec returns to the current kernel, which is unrelated to live update where the state is passed to the next kernel. Skip liveupdate_reboot() in this case to avoid serialization and prevent sessions from being left in a frozen state upon return. Fixes: db8bed8082dc ("kexec: call liveupdate_reboot() before kexec") Reported-by: Oskar Gerlicz Kowalczuk Reviewed-by: Pratyush Yadav (Google) Acked-by: Mike Rapoport (Microsoft) Signed-off-by: Pasha Tatashin --- kernel/kexec_core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index a43d2da0fe3e..dc770b9a6d05 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -1146,9 +1146,11 @@ int kernel_kexec(void) goto Unlock; } =20 - error =3D liveupdate_reboot(); - if (error) - goto Unlock; + if (!kexec_image->preserve_context) { + error =3D liveupdate_reboot(); + if (error) + goto Unlock; + } =20 #ifdef CONFIG_KEXEC_JUMP if (kexec_image->preserve_context) { --=20 2.53.0 From nobody Sat May 30 19:21:54 2026 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (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 A9ECF3C0637 for ; Wed, 27 May 2026 20:27:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779913666; cv=none; b=CLK6BdHyhPB5MLqYKPaTJPzvoo410sjhWItBhfJYyvx67ZVj+N/vtkdx7YiUh+JaBRNEwVnEodwaEk63FdcxTtoMFx9TTuqT8L3RbomR9EWYrNRUNg48D67PACYCqZDZb9xpGLjexCiuNL0KBb+6IS0RBZUE5fxxGFWAikdRGNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779913666; c=relaxed/simple; bh=+j+xxX71SnqkXj49r/GPFwslo70mz+hHgScCaqMuxS4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=roRSnMyv2giuhMKC7G8Sa5ljhnYQlVQniCsUb82yKyR/4kGlWNtvN5X+3wKovGELofgOVyG17rYJyRcS0dK3e1DpGzZ6lJNj+1f2B5TVTT6AfThBsDJZ3C5tbyt8niDYOOqTEJ55aY5qNk9rZwouECOQLGrRptTMXS5rylWKXYU= 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=dfh2cSs9; arc=none smtp.client-ip=209.85.160.179 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="dfh2cSs9" Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-5165195c8b0so132400041cf.0 for ; Wed, 27 May 2026 13:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1779913663; x=1780518463; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=h/XM3jS+J1liNewPoraeZEXRi0gsjZOZDbQIQgPIvPA=; b=dfh2cSs9ByCwpl+Od8HpJQKvu1XPwh5sPAuw/lYfEkuTM3Q7ydHTPfnbmiwSRY+oib 0zfSkbeF2Xx6ibfNElQO8UwziJbWJ0NadxRjvyEFCdOCxUfCX5gvCO3SZRhkcApS+pex xGH/aahqx0bE1yLpDvnI5/tp88dgj/z7WbdxGKhYxbZRRyrdTtIohtzYP7YgTq8PCCn2 URSikTZCevxs8p5mc5FC/yzCSMnIfdTJxoS1I9S7qODhpNBXskZYDLJsLCxJsrAWkU2Q IrEd1Qskra/iKb+P27CqIh9KKpDaJJb209sV4GUX5JyAfpbQs/2pgdRDdwsH9y0JuoBq s8Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779913663; x=1780518463; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=h/XM3jS+J1liNewPoraeZEXRi0gsjZOZDbQIQgPIvPA=; b=m07KOYFJVJFJJMlcAWuPqlVQe6ignYCtvP6Ja/dz3uQJ6hi4x9Qpnkzc0yU5c61apY bQjzqU1mA8Ecxa92LHgRnV6O6/lsPrbch9l0RPmBFRLMtL02yP4tMheZ2Yw9XhClFhsf ymKJrwABPqD1CYPEnztKek1290ZbNW3DQxcnlpeZlImp0UeBmwCQBvER8w03fkeMyisZ MWXvZlZddozPk76H+m0yIiHpx/HLMcrWb0kedM1NWwIXsUAhX9PfKG0ZFluF00uaQJUU KdbRpEIwMD9QWX/BwtkGcWpYGAHkiOOALJrL8Tta7IFA7+1Jonz6BsQuHQAWQ/a8g3da 1E7g== X-Forwarded-Encrypted: i=1; AFNElJ/HmSjvRnNj0nHGhlEJjhVh2rTp27pPdWex+mji9gkKsz1uCS3dlz22nLCYfx180Kh7nJNk1MVo3dDbGig=@vger.kernel.org X-Gm-Message-State: AOJu0Yw8PyioYkPP8FgA9KR40ryDpXwp2yZ9GMtacjA9UaY9zVFfjLAt 75TcfNMK+vQBfTSrQeTO6KuY5ecZuFORG5HWddHunQgbbBgI5R0W27Ynj1vKMqGvE2Q= X-Gm-Gg: Acq92OGbwHfF16cWk6sIrBpjC8V+bCsO1wYypN2I7wGuu4xuyyeXVhyqHoq65yO7dRg z8EzVkLlLMVO+XKfgReKpGBHvyYNZN3DQtuqJKkRfHa7312vsWlVu5dWnz0+5MruzqHWhOSY2L7 DPzVvf1zUzFMWZgm+4HbtKNckQYbITTsusPFyMI1ySuDxGnIibOOzoTZNLwnXpRWw3tcCOhYhOL a80ogzzcodsTIHxBJpmArgyBCam11vgceL9DGhOcoH2B5S10x+xquzkOe/vA5P19O4/eqOGAE1n CzLQ/nO3IklgPl+oxhIlFTQ316qDmo0C8QMueblR5MQyyG/C4VaoHwpHpLeEadik2ioAMZvAUWt KIsYUxh55/FP8hsz/xlq0dScYM17i7wAZCy2O1pfrsbisEhs86DnOxN7TzXnhQIc2LkmVpztdne QuN1hIjez6htFe13e1yMdeI/X8oGbUhfoTAp6BYLHs7A5cfSceC9F/WO0wth1oyg== X-Received: by 2002:ac8:5f46:0:b0:516:ed02:c85f with SMTP id d75a77b69052e-516ed02d766mr217487011cf.9.1779913663594; Wed, 27 May 2026 13:27:43 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-517069ecb93sm58632971cf.4.2026.05.27.13.27.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 13:27:42 -0700 (PDT) From: Pasha Tatashin To: rppt@kernel.org, sourabhjain@linux.ibm.com, jbouron@amazon.com, akpm@linux-foundation.org, error27@gmail.com, bhe@redhat.com, linux-kernel@vger.kernel.org, pasha.tatashin@soleen.com, 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: [PATCH v6 2/5] liveupdate: fix TOCTOU race in luo_session_retrieve() Date: Wed, 27 May 2026 20:27:34 +0000 Message-ID: <20260527202737.1345192-3-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260527202737.1345192-1-pasha.tatashin@soleen.com> References: <20260527202737.1345192-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Extend the scope of the rwsem_read lock in luo_session_retrieve() to overlap with the acquisition of the session mutex. This prevents a concurrent thread from releasing and freeing the session between the lookup and the mutex lock. Fixes: 0153094d03df ("liveupdate: luo_session: add sessions support") Acked-by: Mike Rapoport (Microsoft) Reviewed-by: Pratyush Yadav (Google) Signed-off-by: Pasha Tatashin --- kernel/liveupdate/luo_session.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_sessio= n.c index 74c39d93d45a..169131642939 100644 --- a/kernel/liveupdate/luo_session.c +++ b/kernel/liveupdate/luo_session.c @@ -443,12 +443,11 @@ int luo_session_retrieve(const char *name, struct fil= e **filep) struct luo_session *it; int err; =20 - scoped_guard(rwsem_read, &sh->rwsem) { - list_for_each_entry(it, &sh->list, list) { - if (!strncmp(it->name, name, sizeof(it->name))) { - session =3D it; - break; - } + guard(rwsem_read)(&sh->rwsem); + list_for_each_entry(it, &sh->list, list) { + if (!strncmp(it->name, name, sizeof(it->name))) { + session =3D it; + break; } } =20 --=20 2.53.0 From nobody Sat May 30 19:21:54 2026 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (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 D255A3C2BB3 for ; Wed, 27 May 2026 20:27:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779913667; cv=none; b=fq60gakTkQN8heEzY+dM0uO58jQ+A3hBQ/Ro2iRypa4dU9wB5JJK00OyCbIJYMNkzeAxAPRNRZUeaIrGV5gunoTEetPCfJYJQf89PRQWQ3oLiI7cVYzMIE68/JsXqBfvxmP2b9RjPn0SCQJo5JfBBFglTJ8xjC3+rGdxZ7IM0/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779913667; c=relaxed/simple; bh=vPAGkIjdu7ieKgWANSn3ZOT7krsmCN9Y9p9TAc4gK2U=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cXZLZRvWM94GMqcHbJfNi8wjiATRMkood7k+6OuJkZ1H88VnkwT+A7cg/4Dnqg7tlOndoch5yQH3WLq2W1f2rb1ioO0yOrGs/t7n08rbReIzbJOi9kwcjPla173pAnzAFpR6E5i4lKbtIeCHNRmjBcbMPtd6pwsgqpmV8enA7u4= 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=GT0MTS8e; arc=none smtp.client-ip=209.85.160.172 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="GT0MTS8e" Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-5102582e23eso95727351cf.1 for ; Wed, 27 May 2026 13:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1779913665; x=1780518465; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=AT71iKwUwI8whWewLCYQhrlw3tPdCBLewAlZei6IHqM=; b=GT0MTS8eK14S6XEa/j56f3dd9jMFtuoOiN55kRZSiy+T2Xl/i8fDTRiqfPo5VBhVND We6i9q2VXRc4NkzPz2KXsTuhP8qsupzto0OMWTDV5qYOxFPdhvaui/Oq5Ru7iETY7IOp Or9fLyM/vcobYdfV8+pverDIAInaiYIsynFwYRWAVOCajyTpHd1L9v5iJStQ4coGEYl6 /+KTzjrNIvM9wS1YUUwb7/6KQ/HcogfAFVKN4DBlsBszs/BAJ+eCyuWARXvC0rPgict0 YUJSTx9brD3//TpA6oprCCIWItymPR+L7MmCnfclikgQaM8ay+zbT1WPuBUSz0yLVetp LYYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779913665; x=1780518465; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=AT71iKwUwI8whWewLCYQhrlw3tPdCBLewAlZei6IHqM=; b=AFhKWgzXk1WTPKKiJkbHRyevJj7DD9bJZ5+Uwss2Hbt8A4/urjOFvNnkwaUSRVV6LP 1lSii69xSyNkRFtbsZYyL7s6zMUUFHLQdTP14ksdMjkIwUMjfL0qPqVqEZyB4dISMRls bd1D8btpqTm7ezdWEf2Ta0mGTMadgLk7Hg3IQGndy9U1vpbrJvN8kYX5F2tGCzJI5Gwy Ef4SCwgqCEMOevMiP2JyibjbWnUB/KZkTgbz1l/W7PhWhKmJoW7OKJtHKFJ6ZMdlTuj1 qxF6Rl7Ugpy4wACochYbaeEdoiAgbkpr0hp6kxUrfyglJXgPtlYZ6+Sv5vDeacVgEZqm boRg== X-Forwarded-Encrypted: i=1; AFNElJ+WwUOt8NboG7fJIadCaq+I5EzWNEU1bFIV6YEgUuWxXe5ey671v4ZuvWBHPmT5ZRuz4Q9ku5ugVoI2/K0=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2vYN3SgMRA+XKutnWv9pryo5FuniPgkyztGaM6SDBrmspWuLG mxSKh8gDTfCTMScPNiUya52QbK4lICSiVRgssfOXlgS9DqU+Qg+LHFTuZuDs45lym7Y= X-Gm-Gg: Acq92OEYiqH6KHvb/3th/CGYhrOx3+6H3SYo9PVaDorZl+lyoGhl7uJ5AdK4iN4dy1l z1cycMWxctOUP/zKAwRbFNVP685EvkVYIoWvaAyBSRiwUvfzF2hnWOwrbVxpzgwoDeWJ6htH2xO jrQDSZjbbwLZl8mJdWcY165fLStvTsJyzIto3keBhv0UvNNciiA64XQ4Fv7UYKyzH8XJDsoDhID nDOSaBOX30ceIZG7IgUuBvaQVzFoYLXMy0WqnFemz2gL3xyL4GKORPLrKKZYHJ8na0eTIeHyKrt aHjBw9D1qsYFCyXX6PsB0sLkK8o8Lkf1dLhvaw6gpCeofWohe+NduWkZSqnY5d5bdw+78WLHK/K gn0rv3vRVvDPo+j3I8LWOJ5GyWtTitcI2CozTpVLnCMOzvCOEzC5LBRKV7hUy17qn1OAA37Je3t 9wsSO5YPhwpQwanXbOQBmiDiuGh4fL6UXhfIFhgk6ckR142dzKf/Gr8d6oEBji/Q== X-Received: by 2002:a05:622a:480f:b0:516:d955:ea6 with SMTP id d75a77b69052e-516d9551436mr335310291cf.14.1779913664822; Wed, 27 May 2026 13:27:44 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-517069ecb93sm58632971cf.4.2026.05.27.13.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 13:27:44 -0700 (PDT) From: Pasha Tatashin To: rppt@kernel.org, sourabhjain@linux.ibm.com, jbouron@amazon.com, akpm@linux-foundation.org, error27@gmail.com, bhe@redhat.com, linux-kernel@vger.kernel.org, pasha.tatashin@soleen.com, 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: [PATCH v6 3/5] liveupdate: block session mutations during reboot Date: Wed, 27 May 2026 20:27:35 +0000 Message-ID: <20260527202737.1345192-4-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260527202737.1345192-1-pasha.tatashin@soleen.com> References: <20260527202737.1345192-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" During the reboot() syscall, user processes may still be running concurrently and attempting to mutate sessions (e.g., creating, retrieving, or releasing sessions). To prevent this, introduce luo_session_serialize_rwsem to synchronize mutations with the serialization process. All session mutation operations (create, retrieve, release, ioctl) take the read lock. The serialization process (luo_session_serialize) takes the write lock and holds it indefinitely on success. This effectively freezes the LUO session subsystem during the transition to the new kernel. If serialization fails, the lock is released to allow recovery. Fixes: 0153094d03df ("liveupdate: luo_session: add sessions support") Reported-by: Oskar Gerlicz Kowalczuk Acked-by: Mike Rapoport (Microsoft) Signed-off-by: Pasha Tatashin Reviewed-by: Pratyush Yadav (Google) --- kernel/liveupdate/luo_session.c | 56 +++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_sessio= n.c index 169131642939..c9bdad2e5ae7 100644 --- a/kernel/liveupdate/luo_session.c +++ b/kernel/liveupdate/luo_session.c @@ -46,6 +46,38 @@ * 4. Retrieval: A userspace agent in the new kernel can then call * `luo_session_retrieve()` with a session name to get a new file * descriptor and access the preserved state. + * + * Locking: + * + * The LUO session subsystem uses a three-tier locking hierarchy to ensure= thread + * safety and prevent deadlocks during concurrent session mutations and ke= xec + * serialization: + * + * 1. `luo_session_serialize_rwsem` (global rwsem): + * Protects session mutations (creation, retrieval, release, and ioctls) + * against the serialization process during reboot. + * + * - Readers: Taken by any path modifying or accessing session state (e= .g., + * `luo_session_create()`, `luo_session_retrieve()`, `luo_session_rel= ease()`, + * and `luo_session_ioctl()`). + * - Writer: Taken by the serialization process (`luo_session_serialize= ()`) + * during reboot. On success, the write lock is held indefinitely to = freeze + * the subsystem. On failure, it is released to allow recovery. + * + * 2. `luo_session_header->rwsem` (per-list rwsem): + * Synchronizes list-level operations for the incoming and outgoing ses= sion headers. + * + * - Writer: Taken during list mutation operations (inserting or removi= ng a + * session from the list). + * - Reader: Taken when traversing the list (e.g., retrieving a session= by name). + * + * 3. `luo_session->mutex` (per-session mutex): + * Protects the internal state and file sets of an individual session. = It is + * acquired during per-session operations such as preserving, retrievin= g, + * or freezing files. + * + * Lock Hierarchy: + * `luo_session_serialize_rwsem` -> `luo_session_header->rwsem` -> `luo_= session->mutex` */ =20 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -75,6 +107,13 @@ sizeof(struct luo_session_header_ser)) / \ sizeof(struct luo_session_ser)) =20 +/* + * Protects session mutations during serialization. All session mutation + * operations must hold the read lock. The serialization process holds the= write + * lock indefinitely on success to block all concurrent and future mutatio= ns. + */ +static DECLARE_RWSEM(luo_session_serialize_rwsem); + /** * struct luo_session_header - Header struct for managing LUO sessions. * @count: The number of sessions currently tracked in the @list. @@ -205,6 +244,7 @@ static int luo_session_release(struct inode *inodep, st= ruct file *filep) struct luo_session *session =3D filep->private_data; struct luo_session_header *sh; =20 + guard(rwsem_read)(&luo_session_serialize_rwsem); /* If retrieved is set, it means this session is from incoming list */ if (session->retrieved) { int err =3D luo_session_finish_one(session); @@ -382,6 +422,7 @@ static long luo_session_ioctl(struct file *filep, unsig= ned int cmd, if (ret) return ret; =20 + guard(rwsem_read)(&luo_session_serialize_rwsem); return op->execute(session, &ucmd); } =20 @@ -417,14 +458,17 @@ int luo_session_create(const char *name, struct file = **filep) if (IS_ERR(session)) return PTR_ERR(session); =20 + down_read(&luo_session_serialize_rwsem); err =3D luo_session_insert(&luo_session_global.outgoing, session); if (err) goto err_free; =20 - scoped_guard(mutex, &session->mutex) - err =3D luo_session_getfile(session, filep); + mutex_lock(&session->mutex); + err =3D luo_session_getfile(session, filep); + mutex_unlock(&session->mutex); if (err) goto err_remove; + up_read(&luo_session_serialize_rwsem); =20 return 0; =20 @@ -432,6 +476,7 @@ int luo_session_create(const char *name, struct file **= filep) luo_session_remove(&luo_session_global.outgoing, session); err_free: luo_session_free(session); + up_read(&luo_session_serialize_rwsem); =20 return err; } @@ -443,6 +488,7 @@ int luo_session_retrieve(const char *name, struct file = **filep) struct luo_session *it; int err; =20 + guard(rwsem_read)(&luo_session_serialize_rwsem); guard(rwsem_read)(&sh->rwsem); list_for_each_entry(it, &sh->list, list) { if (!strncmp(it->name, name, sizeof(it->name))) { @@ -615,7 +661,8 @@ int luo_session_serialize(void) int i =3D 0; int err; =20 - guard(rwsem_write)(&sh->rwsem); + down_write(&luo_session_serialize_rwsem); + down_write(&sh->rwsem); list_for_each_entry(session, &sh->list, list) { err =3D luo_session_freeze_one(session, &sh->ser[i]); if (err) @@ -626,6 +673,7 @@ int luo_session_serialize(void) i++; } sh->header_ser->count =3D sh->count; + up_write(&sh->rwsem); =20 return 0; =20 @@ -635,6 +683,8 @@ int luo_session_serialize(void) luo_session_unfreeze_one(session, &sh->ser[i]); memset(sh->ser[i].name, 0, sizeof(sh->ser[i].name)); } + up_write(&sh->rwsem); + up_write(&luo_session_serialize_rwsem); =20 return err; } --=20 2.53.0 From nobody Sat May 30 19:21:54 2026 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (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 1F1E53BF684 for ; Wed, 27 May 2026 20:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779913668; cv=none; b=hnCHj1XLBjBjjumTyS85fApQ7xzAZCvhp6Aw1I3hKp4hah7NTWAY9RXxDPor4xw0DcBNuLZwLNzl0hIpSzpr1CW8c8eF21r+k0MkKnXydLEWdr/EYQST1HUufg++LV2cjY3WRIAvRyVwCBPqrufO+iPLrGkwi/ioqq7/akwmu70= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779913668; c=relaxed/simple; bh=hiyEHjmCYppfTy7QhPQlVU1tTK59trKB+8wNxIxpnCo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZDugO9ei2zs4Ch3AZsGzMc8ebmbtlRIJxaqW7jml7C2oZUP5Jpm3fALy7m7Prjw7KTHFUeiYwIHE2vHw7hcoPX7zojWWUFy0EEpBiXlRf9uaBNtV/DEGe3lKR/rbF7iHHKyAXWT6WT9b9hxGTzrHoFTEoUTV2is/BDOCcKezjbE= 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=Or1vtVgY; arc=none smtp.client-ip=209.85.160.172 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="Or1vtVgY" Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-516d61baff3so64332201cf.0 for ; Wed, 27 May 2026 13:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1779913666; x=1780518466; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=yM8dMZ14jd8XfzqLrOXjgKwSIjFfEWKpVFgfL5nrU6g=; b=Or1vtVgYIQZW9dMaFeN5r5ZvyAxZVNmAA/XEbdvn9eg0wGn08PqwADOXvcv5AtlL9/ 9FjMjeu5Jw9SQ/aUPsLuHU98ZrwjfCXEDCK+193JzRInXJoGRdPGSBECvlbQy3KI6EWv El/zatqf+7jirVdoNERljzeyvXBCsqTydl3gt7B2LQyz2fUgnpsEZOerxWQqOhfkMB0B Lttx37r/ayS4WcK1UnJxTBbUXU5C+KJqVIKkrwbUOAAIgMzDZQ1dQi+f17xcgzB9gXYR eA1erjBCeHR7rzsUpU3ejo+WHGVs9iGnuvsDkX7+ec0SYgTBV5fvsgh5hjANtaNQ88AJ rk1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779913666; x=1780518466; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=yM8dMZ14jd8XfzqLrOXjgKwSIjFfEWKpVFgfL5nrU6g=; b=HS+oBCA5dOB3x2RkdF+87cEK5tL2rUHexu1CEoGi2eSsWIQytgu0ShTmNEko0CcXPc LQNXGUpj/PM0a2nV0IWV+tXvowhofXUJ9orWNaSBNSbPkzgFxHbjxIjOUsgSFlEO8cjd DSM1kGk2xr3f7dnZ8ukIbP6Z52LO9E/ImRKUClLQT1+jU0FhI8PsyzSTNA/4oqyERkNy hwLdMMqbRgMiRXtxOFPA/rUYW7PZz6athbm4mu0NYAFeLxz6XdMphN05ot8n4CHAQXip b9ROPUjr4QozVhMyJ3VUBv1GONNrugILdII8vSo95HMWcyQXe5pbYGEVHom9F6RMv6SP mKJg== X-Forwarded-Encrypted: i=1; AFNElJ/juEMvnonbpM8rbzuLswgLI3a/nby/4GymoBZ9ITsygqGOS+axk1uYzW8/LJrHGUuYUh9H+8zrVck52W0=@vger.kernel.org X-Gm-Message-State: AOJu0Yz0t/MT3fAC6GPd/hjqUg4JZrZqwDjSMOHTxY3l8bsiKr9fmSgF 1KTPHHIiIBQ3jlfra1gCCa7CZxktVBf8HBDsDu/gan9YU3FGG/4epwBOY+F60UUq55o= X-Gm-Gg: Acq92OHKKQB6h8BP/RyLqes6HM5//RiCcIzbCZJu/7sgmKEFMfiNvIFyqq9+FRhp8bM 84QLY4VDRH86hwzbOwCNh3yXJ4iDpV7RYNfq3WkE53MDI+1pnEQvapc2JgS9gnLWkg1Lu3fC+93 JKbP2wV4oxgaZJGjp/2smrR/OzOV91j01qJiKcpaFiQxTnpeWnPAPoWKZQE1HBIX6nYkWqZ41h0 GBp+tHAUAqaCqJUIYmUmIkPCws1MbUROWDFYG6DPgblUiEcH5peWVjjInElVkBFckuGRfr0CPsH DF4p35DAGNYNzFGVgE9jKXKAGJ83HA2j51iZZvqQRUCNbYul4gZu2q56CMoV92HY/0L/8YYuPnf onReSkqpwpzSHmIXOqWSCVDtWgRw46IN6ae+k9pmT67nQNHeCaaKxB0br555fZt8ciTmv4uSR6N Eh3eqwU8bAIn3UfJsYZ2yHuQ+5TH8GKYCCIUi1wLG+JZMo+pdvtlPzBCeIwO8iBg== X-Received: by 2002:a05:622a:1b27:b0:516:ef49:f6f5 with SMTP id d75a77b69052e-516ef49fc35mr220633931cf.39.1779913666151; Wed, 27 May 2026 13:27:46 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-517069ecb93sm58632971cf.4.2026.05.27.13.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 13:27:45 -0700 (PDT) From: Pasha Tatashin To: rppt@kernel.org, sourabhjain@linux.ibm.com, jbouron@amazon.com, akpm@linux-foundation.org, error27@gmail.com, bhe@redhat.com, linux-kernel@vger.kernel.org, pasha.tatashin@soleen.com, 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: [PATCH v6 4/5] liveupdate: fix u-a-f in luo_file_unpreserve_files() and luo_file_finish() Date: Wed, 27 May 2026 20:27:36 +0000 Message-ID: <20260527202737.1345192-5-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260527202737.1345192-1-pasha.tatashin@soleen.com> References: <20260527202737.1345192-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In luo_file_unpreserve_files() and luo_file_finish(), reorder module_put() and xa_erase() to ensure the file handler module remains pinned while its operations are being accessed. Specifically, luo_get_id() dereferences fh->ops->get_id, so the module reference must be held until after xa_erase() (which calls luo_get_id) completes. For luo_file_finish(), this requires moving the module_put() call out of the luo_file_finish_one() helper and into the main loop of luo_file_finish() itself. Fixes: 00d0b372374f ("liveupdate: prevent double management of files") Acked-by: Mike Rapoport (Microsoft) Reviewed-by: Pratyush Yadav (Google) Signed-off-by: Pasha Tatashin --- kernel/liveupdate/luo_file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/liveupdate/luo_file.c b/kernel/liveupdate/luo_file.c index a0a419085e28..208987502f73 100644 --- a/kernel/liveupdate/luo_file.c +++ b/kernel/liveupdate/luo_file.c @@ -385,10 +385,11 @@ void luo_file_unpreserve_files(struct luo_file_set *f= ile_set) args.private_data =3D luo_file->private_data; luo_file->fh->ops->unpreserve(&args); luo_flb_file_unpreserve(luo_file->fh); - module_put(luo_file->fh->ops->owner); =20 xa_erase(&luo_preserved_files, luo_get_id(luo_file->fh, luo_file->file)); + module_put(luo_file->fh->ops->owner); + list_del(&luo_file->list); file_set->count--; =20 @@ -677,7 +678,6 @@ static void luo_file_finish_one(struct luo_file_set *fi= le_set, =20 luo_file->fh->ops->finish(&args); luo_flb_file_finish(luo_file->fh); - module_put(luo_file->fh->ops->owner); } =20 /** @@ -738,6 +738,7 @@ int luo_file_finish(struct luo_file_set *file_set) luo_get_id(luo_file->fh, luo_file->file)); fput(luo_file->file); } + module_put(luo_file->fh->ops->owner); list_del(&luo_file->list); file_set->count--; mutex_destroy(&luo_file->mutex); --=20 2.53.0 From nobody Sat May 30 19:21:54 2026 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (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 9C15B3C2764 for ; Wed, 27 May 2026 20:27:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779913670; cv=none; b=qvmPahke5jdH/Etxh//kmuPyY4McpRmiCcmTY2fO2UCGO3ilsxgfPXIIWQT6J4p7p+8OkmFLVat6kvmQqgl3ykZC+9BnY4As/p7D5jfRM8E2TNesz1Gz8heRTL4k1E0VF6vWsw30huXWIRSOEKBlSYWhMFW6MZn/L9RNgo+Vlj0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779913670; c=relaxed/simple; bh=4Pm16VSE9k8+M+8fx3Ut30Lt8MxYyOe3h5Lk54+ujr0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YQSM0ZKsfVBlkLxmYdgkfunoM+RgKMMMix9tIxMtsBvnFr4i2HSsavh/Z+6ptZrdIjfMSlIbkeUDXI08gJiOff4FqnbLLXtuOm8TZGwB12/EgqIw/1boU5rnfjRNi0KL03B13NnAG9ZVW7oC13s/O5hjT4hYH5ZhA+VZaMDEADg= 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=FSM50w/h; arc=none smtp.client-ip=209.85.160.170 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="FSM50w/h" Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-516d634956fso65999881cf.2 for ; Wed, 27 May 2026 13:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1779913667; x=1780518467; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=5gjpcJOSlaxgR0u1Wf2qLG73MMh7gIWFnRjw8KOPySU=; b=FSM50w/hN9A4WnbS63TZ71r1rs7Vzmu3VW6Wpx9Qx7d2TDTU+b/0I+WZTyypjbMNmY oP+fNVDrRVM4E+Z5lKMc4c+27K/EtSp/8k+8tqykY6RmlXQ2g7dChhtzDIPZZ56sdAeB ogeMOTLjiHLMPRSjf6veDXBc7MfnkloWgNEhlm7RfZBVs3HCt44DV8WurCxOS9fHjvRP NZae3OL6lDgdWWinUiOKd8EY3a1RPWT2B6wDyY507ayhoujRR8QpeQZO4vnjIBaeRqAo dB3qeCcvEqLbzqUbnsAG3z/qTxGVEXo5jthKWTnPwEYx2QRatykEXNtyreXVleFbJXPf bZFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779913667; x=1780518467; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=5gjpcJOSlaxgR0u1Wf2qLG73MMh7gIWFnRjw8KOPySU=; b=IocIUzY4cZbb/dHgM2PryEnkaXyecE9iBfNAUDFyqZcxoRczAC6DunUxlVUornP5xe 4yntZvRoIcbxlpSh1MtBNIls7rIU1+sdExYfvkcwf6PVOffKjjquTGGFmblTQsOprcnG SsViTJkpnLYdkPndqTlj2bjYrI/1iTQK4VKvxVMQwKq4wUEDCrEf88NnK4EzzPOGkJOl iOkkiEL3Lzdd7NeyVZWx44SyMWi2n3vYp689birTAR+tBAj49ScSoWL62xhYtIHHApj2 3XacNq7urlnC8Q4xhg3ZBuV0gBIMl4RdSWaK2ow+FbxDPPbGhaxEdpbIO4osgzOgs17z 9MCw== X-Forwarded-Encrypted: i=1; AFNElJ8/qDfrmbggUqag6h1g3qWx2B2RT0xFZmPgJVXNZw7S+g9ARh6vMY6uhmIdUgLSXM67z65DRceGhCRtxuc=@vger.kernel.org X-Gm-Message-State: AOJu0YzP4+9h/FiBDiyC/bBFBpjz08KYP2ai/oJb5nQ9byeMeufMTm7Q j605JZsKNOeM15hZnTMY5trl4gWyorX8XLtrT/ej6+9XJxe6VZVjZ8zLGaC418sPoo8= X-Gm-Gg: Acq92OE0nEJurwJQs9XOzkjcBdS4HYZo8GyOVccGbkrBBJkaiaf+B1QThzaYpKaBEHW rTwTH+NtNOpQZncwY5P5vpp7MtKc99+bSPtHXoqVCD96tzLHi1JLB3OY57iS2/4jMxkAKYO9/bl z7n0XBWpHnwJdjA8ARafhXlgop5zC9OjEMfQS5/gU7GLeyWHzqNNTJkTtIdITtb4yakOOOXwKiD bM9ce2xyFWexXQB/emI9zYLvmH7NHN+MKZaqlKzgL0GvLVLyNDmufmN83SIJ0eXQNExP8eq3voe wekY+ymObWkwzgYLVXGBtAk6CLYKkOSUNgViEXcSrC4RflA0b4X7A5WxUoTcQFyfzhkjXD/Me2i WGRhIyh4jqGH7RKJy4EU23/llfvqM4q6T2uFB5vDaWtfQpolm9Oz6xm9Grh1VrGKoVUnwi4VDHV 4hgxEPBnqgvRtPnTtQVim+j3eI+2uTTUNIT+/hXtjWYARywOJW60xkQAlEVMM7Nw== X-Received: by 2002:a05:622a:260f:b0:50b:4a84:aa94 with SMTP id d75a77b69052e-516d42ee019mr344407121cf.7.1779913667409; Wed, 27 May 2026 13:27:47 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-517069ecb93sm58632971cf.4.2026.05.27.13.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 13:27:46 -0700 (PDT) From: Pasha Tatashin To: rppt@kernel.org, sourabhjain@linux.ibm.com, jbouron@amazon.com, akpm@linux-foundation.org, error27@gmail.com, bhe@redhat.com, linux-kernel@vger.kernel.org, pasha.tatashin@soleen.com, 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: [PATCH v6 5/5] liveupdate: Remove unused ser field from struct luo_session Date: Wed, 27 May 2026 20:27:37 +0000 Message-ID: <20260527202737.1345192-6-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260527202737.1345192-1-pasha.tatashin@soleen.com> References: <20260527202737.1345192-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The ser field in struct luo_session was intended to point to the serialized data for a session, but it was never actually utilized in the implementation. All serialization and deserialization logic consistently uses the pointers maintained in struct luo_session_header. Remove the dead field to clean up the structure. Acked-by: Mike Rapoport (Microsoft) Reviewed-by: Pratyush Yadav (Google) Signed-off-by: Pasha Tatashin --- kernel/liveupdate/luo_internal.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/liveupdate/luo_internal.h b/kernel/liveupdate/luo_inter= nal.h index 875844d7a41d..dd53d4a7277e 100644 --- a/kernel/liveupdate/luo_internal.h +++ b/kernel/liveupdate/luo_internal.h @@ -59,7 +59,6 @@ struct luo_file_set { * struct luo_session - Represents an active or incoming Live Update sessi= on. * @name: A unique name for this session, used for identification and * retrieval. - * @ser: Pointer to the serialized data for this session. * @list: A list_head member used to link this session into a global= list * of either outgoing (to be preserved) or incoming (restored= from * previous kernel) sessions. @@ -70,7 +69,6 @@ struct luo_file_set { */ struct luo_session { char name[LIVEUPDATE_SESSION_NAME_LENGTH]; - struct luo_session_ser *ser; struct list_head list; bool retrieved; struct luo_file_set file_set; --=20 2.53.0