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 D0A8331CA51; Mon, 18 Aug 2025 13:02:10 +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=1755522130; cv=none; b=e35Mw0sd2Xy0UTgrK+r+AVNWBa6gWQZtoCi5N3TbXYApqduF9hvjcUFdgmJl+pXAOdR820Q+sXixUFrTm0mCi6Ea25ggITvaSuy3rAwn8/1Ae8V44oDrIh/noPfrzpU2wDNUanZP5xF3FUxliJoqCe5KRP0l5Syajzv6iU7iB6E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755522130; c=relaxed/simple; bh=VN382YUXGIHrORcccBu3kqOGaJ+qafhfiwhcuVuV59U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BDy6omBjlNQQ5rfLIb/X3aiIRUhMusjfG84Qe7wMk5ccwd6Wq9pn5zTEGdKxgW6svInVu23AD7gER57lm6MCEv6hVL+ACR5sMci3vGZZoBcNtKI4QpkJ7I42jRvoyKy+PrqZmFxk/5L064z10pElNxu5MbOvfkYsoidhh+A0KZU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=T602whUC; 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="T602whUC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B22EC4CEEB; Mon, 18 Aug 2025 13:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755522130; bh=VN382YUXGIHrORcccBu3kqOGaJ+qafhfiwhcuVuV59U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T602whUCMSsgzF54t2iirH0UrWoyV6CANrRV7jYaJh2WD0lw1e0IDLekSauTeB4uy w7DyXxnK+QMNpGkQI0EUH7RJb6c/Wq/a+xJNZEw3F+uPLrBmTeiBvGggxo5GRwgWYv 8gyM3d5Glb82YnObQvw6GgKfMnzjByolSvxE4sTg= 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 6.12 181/444] net/mlx5e: Properly access RCU protected qdisc_sleeping variable Date: Mon, 18 Aug 2025 14:43:27 +0200 Message-ID: <20250818124455.661629068@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124448.879659024@linuxfoundation.org> References: <20250818124448.879659024@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 6.12-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 f0744a45db92..4e461cb03b83 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c @@ -374,7 +374,7 @@ void mlx5e_reactivate_qos_sq(struct mlx5e_priv *priv, u16 qid, struct netdev_que 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