From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DC8F032C957 for ; Mon, 18 May 2026 16:13:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779120786; cv=none; b=PyFkins/MgkPJY/0JVR4krIzAJzXaRIcp1an89ik2pFVTqYzBHYGzo1WuPZZovPnj8+eMPJXQR2lRkpsWHmW76rkxN4iulbYVddsLuffnzH+7rfwX6gaaxGEhJpdg2qVGuTpyeYedVer5bq6s+fSpwl8q65y8DRa71/N8XPy8VA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779120786; c=relaxed/simple; bh=raMKx6Stu/7Zl70P8bwT58GnJzUQ+aRrbtvxtvfijnI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=c4EpViYCQnB1LyrLLc7DAzdp+FPL2p2DMCNwb5fA+8CekflMpl78dWous7S+7vox/ySbAI7r4V+NURYrvyTEIbs20H+ZSfE5qD39qR1rXQY3j6PMkfRoApce/d19IoMSQOL3V+naTq1jiPUjjuxlCTa9/FFknbbYmILgR1blbMs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RQypuo5g; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RQypuo5g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A879AC2BCB8; Mon, 18 May 2026 16:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779120786; bh=raMKx6Stu/7Zl70P8bwT58GnJzUQ+aRrbtvxtvfijnI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=RQypuo5gKzQ1SgqJu7j5Ad7nyMFzOS5MvYwNIwTyMtRV+y8ufV27zOIWPy2pFrjrR 8VBMhn3Y4AKv85nwtgDPxwxDbQf9JKsU1ndbtLCZedxUvCEM58UZasSnATcgCJ0Pgx ehYk8AQZhdaiBJTI5Jj2ofGMx0thXqdJconVy9ns2299Djfo4Og53UAgxAnU2cFiZR gDBzZlqaOmkiLiPOLCE8WyyOgVldTA1/0gggJliJEPDojSBLk4athlLGJtYioIdjcp 5ECwMDoeQUYNYQkhUeBey0rTYaKuVoyV+UejDzbVqYejNPAlBTAJCFLeecozLvj95y CTd7ZaJhqawew== From: Pratyush Yadav To: Pasha Tatashin Cc: rppt@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 v5 2/5] liveupdate: fix TOCTOU race in luo_session_retrieve() In-Reply-To: <20260518125459.1092373-3-pasha.tatashin@soleen.com> (Pasha Tatashin's message of "Mon, 18 May 2026 12:54:56 +0000") References: <20260518125459.1092373-1-pasha.tatashin@soleen.com> <20260518125459.1092373-3-pasha.tatashin@soleen.com> Date: Mon, 18 May 2026 18:13:02 +0200 Message-ID: <2vxz1pf8ae7l.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Mon, May 18 2026, Pasha Tatashin wrote: > 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) > Signed-off-by: Pasha Tatashin I was about to comment that perhaps we should drop session header lock after getting session lock, but I think the session retrieval is pretty fast so this should not matter. So, Reviewed-by: Pratyush Yadav (Google) -- Regards, Pratyush Yadav