From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.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 1A080408038 for ; Mon, 8 Jun 2026 14:58:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780930716; cv=none; b=iTGScfaxn1/L+xcIdU0s8wR1e3/kMPzLL7T9Hy/iifLaEjfSxxgXeaSM+JOf674NmT/y+adXmFKIJPYsoEaLOA7xLMOhNx00Zs5bBz6SznofFpMaWkV7Uo++soi9/6XuaFGm46LhOHCUjz7BTjI2T/H4vukG50PCeMqS8LojsVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780930716; c=relaxed/simple; bh=Ld/wS7rp+k+60ju85h/avqZuJos61qGFsY6Lm2elJ4I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SBEI+vIVYLT3+CrMo/uRHh51MA74de9+wELekqEXYgwvFHhSud/ykIDjQUx3sYgck7ygkIaQHRc9J5ARjBG0s/LBUAOhc4vYfEBOJ5Fri20DnFrvfBmj5kmmXzUVYFpQI9J02/jDFk2plcPi7e46+pR3GYB5VRnGODx4cbArkt4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=minyard.net; spf=pass smtp.mailfrom=minyard.net; dkim=pass (2048-bit key) header.d=minyard.net header.i=@minyard.net header.b=CnYJjjDp; arc=none smtp.client-ip=209.85.167.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=minyard.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=minyard.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=minyard.net header.i=@minyard.net header.b="CnYJjjDp" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-486304fa184so3944847b6e.1 for ; Mon, 08 Jun 2026 07:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=minyard.net; s=google; t=1780930706; x=1781535506; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ynytDHRd76bMUHNmTQQewW2EWsRcgHarOHL+9T2G+3M=; b=CnYJjjDpeQ3/8AcSkDLdtwDnCEbOcKNUdtexOde7xaKwKMtNE3141sEOIn3QqhOoHi om3Fa7yWB0jLTXNJ6zjV/nwyWmGjz9U87xfCDE4g09bvBbRr6DK/RETSP43eOx9JKcnK E3aYCP02LwKxkXFhkv3SyLYf009J3q2m71+QQ4yhyLF+G5ZpcBn5MeNU3LqJtYqUB+DA WIi95NPNR4wXSyI2WzGwr+3WN/10qgj4olw5sLKXipYQhD2CPyrZt/+VgIZgUO3eXn7H 9ekePteF1oAB4Cy1BznUk2r4dCeTEIFACBKA+an5Ty3SLUvqHeWxQfKcK0movjlG7MLj Bizw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780930706; x=1781535506; h=in-reply-to:content-disposition:mime-version:references:reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ynytDHRd76bMUHNmTQQewW2EWsRcgHarOHL+9T2G+3M=; b=Zli5SRwxI2wIpwz61GjJ2+0qpyd1Y1KRGvMhHpxt4ImTtNM5s1nkEE5e9MKDsFZNtd AeqzaVrWHTEe0e9M5a3WmYVy5HAuQ4Y+NVkRZnmiQxI/X5+XofyNNvk64j1zkytMpgPc k+38AranHieeRZ23LVFpHJHkEob+mRfjQJaxk5AEZhNIyaROOK/vZHVSJrMWw5Ydd06t H3v17EWd+1FaR04fJX2y3npgwZ15GQE+PGqKQeREo1ONm1Bp+s/RTJlVjhx2V62C6eIn hc6+GrH3qh3mECA35SW7CzmNEI6UVY0WoPvrDuAnKuGe5coJzmyyw7iZMBba2CMS5VbI JjXw== X-Forwarded-Encrypted: i=1; AFNElJ/jr176YDG6C/TdbkLMrSzr7Xvf3hLBm3frkwf6opwBygboC9SRTxkh0Z7ImQ4jNzh28siWyvXR2M9aOBM=@vger.kernel.org X-Gm-Message-State: AOJu0Yz7PbEFiGlylOTgR16WFAICoV5EKsC9D+U0etMcicCwtTNiiKM0 +YLPgJKoHium8KkOoU2lbJS62cqQh/gX2Q/cfBC9E+yE8xp/hv8AHPo540O8LqmARsyv7rnXbaS JViyR X-Gm-Gg: Acq92OEUmssW823OcZu/G9TK1xu6A1LdT4VzBb8ulEsIykJHcEexAN+El59PqTi7/Fz I+RgpcLVz6Gz3GKCeqiF2eV0ZQmPDLswClLD/pvlHXCHL7aSeT2bZ3DjjtO/Ar+ZXyPBErWEzTh rslwPK90apdiN119wfUdK0qJob0ZrRfr3q/dnHMKfwujI6ngqYZQH9IHnr4llhiIgl/5PjJrLv/ EjsaUvGIMv4hEvIvPgo/OGJlYQr1FdIrelvp2fj2f89rTJjgARrw7mOIiYg/HUgIsnOEWHNxI6v ckh0wJNvnlv1if+v8aYQpjAxbgQ+WmzVA3S5/SB6vPPvSc8C8Zr09MucEvkW2P2z3hcEtcVUZob Umo3IqFIRM2pZ7oHB6Y0qO7/qRIcxrMcmz/7yiL8cp2GlMovxltFQLU4L3LE6SlzIngWdUm29/S Bpjd/nki8AxZtrswpsfTjjuZIuOW1J3aZPYT5h9NifWJYLNrzrgpP+wp+duW3d7A7YPqIdm2Klt m98ZcdUAqBa2MpxQOrNEUaQ+qM= X-Received: by 2002:a05:6808:4f0d:b0:479:db65:8dbc with SMTP id 5614622812f47-4868df59fd2mr10212483b6e.30.1780930705722; Mon, 08 Jun 2026 07:58:25 -0700 (PDT) Received: from mail.minyard.net ([2001:470:b8f6:1b:cbbe:5d8b:b4d0:52d4]) by smtp.gmail.com with ESMTPSA id 5614622812f47-4865b745773sm14464153b6e.6.2026.06.08.07.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 07:58:24 -0700 (PDT) Date: Mon, 8 Jun 2026 09:58:19 -0500 From: Corey Minyard To: Rui Qi Cc: Corey Minyard , openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH v2] ipmi: Fix rcu_read_unlock to srcu_read_unlock in handle_read_event_rsp Message-ID: Reply-To: corey@minyard.net References: <20260525063235.990101-1-qirui.001@bytedance.com> <20260608112000.1-qirui.001@bytedance.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: <20260608112000.1-qirui.001@bytedance.com> On Mon, Jun 08, 2026 at 11:27:54AM +0800, Rui Qi wrote: > Hi Corey, > > I'm following up on this patch which was originally submitted on > March 25 and resubmitted as v2 on May 25. I haven't received any > feedback so far, so I wanted to bring it back to your attention. > > To recap, this is a one-line fix for handle_read_event_rsp() where > rcu_read_unlock() is incorrectly called instead of srcu_read_unlock() > on the error path, leaving the SRCU read-side lock held. > > This patch is specifically targeted at stable branches (v6.12 and > earlier) that still carry the original SRCU-based locking. In > mainline, commit 3be997d5a64a ("ipmi:msghandler: Remove srcu from > the ipmi user structure") has already restructured this function to > use a mutex, effectively eliminating the bug. However, that commit > is part of a larger SRCU removal series that is not suitable for > stable backport. > > Since the affected code no longer exists in mainline or your > for-next tree, this patch cannot follow the usual path of being > applied there first and then cherry-picked by stable. Could you > please review and provide an Acked-by so the stable team can pick > it up directly? I can give an: Acked-by: Corey Minyard on this, as it is obviously correct. However, it might be better to backport the changes removing SRCU. Using SRCU here was a mistake to begin with. But that might be too big a change. -corey > > No changes since v2. The patch is reproduced below for convenience. > > From: Rui Qi > Subject: [PATCH v2] ipmi: Fix rcu_read_unlock to srcu_read_unlock in > handle_read_event_rsp > > Fix a bug where rcu_read_unlock() was used instead of srcu_read_unlock() > in handle_read_event_rsp() when ipmi_alloc_recv_msg() fails. > > This mismatch leads to an SRCU read-side critical section imbalance: the > entry uses srcu_read_lock(&intf->users_srcu) but the error path > incorrectly calls rcu_read_unlock(), which is a no-op for SRCU and > leaves the SRCU lock held. > > The offending code was restructured in mainline by commit 3be997d5a64a > ("ipmi:msghandler: Remove srcu from the ipmi user structure"), which > replaced the SRCU locking with a mutex in this function, effectively > eliminating the mismatch. However, that commit is part of a larger > SRCU removal series that is not suitable for stable backport. This > minimal fix addresses the SRCU imbalance for 6.12 and earlier stable > branches that still carry the original locking scheme. > > Fixes: e86ee2d44b44 ("ipmi: Rework locking and shutdown for hot remove") > Cc: stable@vger.kernel.org > Signed-off-by: Rui Qi > > drivers/char/ipmi/ipmi_msghandler.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c > index 188722ec0337..41ae4dac4eeb 100644 > --- a/drivers/char/ipmi/ipmi_msghandler.c > +++ b/drivers/char/ipmi/ipmi_msghandler.c > @@ -4395,7 +4395,7 @@ static int handle_read_event_rsp(struct ipmi_smi *intf, > > recv_msg = ipmi_alloc_recv_msg(user); > if (IS_ERR(recv_msg)) { > - rcu_read_unlock(); > + srcu_read_unlock(&intf->users_srcu, index); > list_for_each_entry_safe(recv_msg, recv_msg2, &msgs, > link) { > list_del(&recv_msg->link);