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 29FC6345758; Tue, 26 Aug 2025 13:51: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=1756216266; cv=none; b=gOdu7PAliBvzlWsu6sKQvCIT0aJ/Uf6oxC3HwWtyGMIN8EDpWc2f/PW7tjvS/QkZmSp8ShKv+6iSo3Fx0bJTRYS9gRnHthSyb/g5+1ghbwpQ7aWJ45iUVJMjI+/7IdW6N3zqPK0BlHnKnimJ6RUBu5a6OCIwMK4MxSLvl4WtkNU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756216266; c=relaxed/simple; bh=P5UCxkHRw5t3aTNcRVIkBQPaMPOoXqXUShrR+gug6u0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=banqwdp38DeDLP+xmp9/q1NyLIwQRyo3CBgpQ+8wQse4tEQnT8zipaA7jLe6ByhqTU8JROCMH21ZTAij8AwdwZJtlb4eBlK5Lb1kOZnjbVNry/OjORQF+qkPBqoeF5UD4QZi9ADAIo/L/uF0pwAPNeUMVxCC/by0gIKSee7XwxQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=J6x+je3C; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="J6x+je3C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AED9DC4CEF1; Tue, 26 Aug 2025 13:51:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756216266; bh=P5UCxkHRw5t3aTNcRVIkBQPaMPOoXqXUShrR+gug6u0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J6x+je3C+6pd5AfD88XQUTSkCVwXAnyO9agqv7hu7hHiDveHW8r+2TWszIPJxcVO4 tTZeUQ3tmxrlovrRKMZBTvDGXGlmzI+8tbncyvLdm0i6ol3p5LZUj4v30PG8oPpeXM B5fxkevDPpOdyzE/2UeBOsXGxxYR5eIyf2hla57o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Leon Romanovsky , Tariq Toukan , Michal Swiatkowski , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 344/644] net/mlx5e: Properly access RCU protected qdisc_sleeping variable Date: Tue, 26 Aug 2025 13:07:15 +0200 Message-ID: <20250826110954.919267376@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110946.507083938@linuxfoundation.org> References: <20250826110946.507083938@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Leon Romanovsky [ Upstream commit 2a601b2d35623065d31ebaf697b07502d54878c9 ] qdisc_sleeping variable is declared as "struct Qdisc __rcu" and as such needs proper annotation while accessing it. Without rtnl_dereference(), the following error is generated by sparse: drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:377:40: warning: incorrect type in initializer (different address spaces) drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:377:40: expected struct Qdisc *qdisc drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:377:40: got struct Qdisc [noderef] __rcu *qdisc_sleeping Signed-off-by: Leon Romanovsky Signed-off-by: Tariq Toukan Reviewed-by: Michal Swiatkowski Link: https://patch.msgid.link/1752675472-201445-4-git-send-email-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en/qos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c index 965838893432..7291ccabecba 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c @@ -724,7 +724,7 @@ static void mlx5e_reactivate_qos_sq(struct mlx5e_priv *priv, u16 qid, struct net static void mlx5e_reset_qdisc(struct net_device *dev, u16 qid) { struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, qid); - struct Qdisc *qdisc = dev_queue->qdisc_sleeping; + struct Qdisc *qdisc = rtnl_dereference(dev_queue->qdisc_sleeping); if (!qdisc) return; -- 2.39.5