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 224F9335BC5; Mon, 18 Aug 2025 13:55:43 +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=1755525344; cv=none; b=k1pdHUrnOp4f9pDPv6KIIE+3/EGcVfowuOlmebhgD9dGNvbIRU+jhA1vOXyjv+V9iU7/rEmyCFEp5nAki9wIaC3lq8EdC3kfAUduKMPN2TxTfoO6Qp3DZENTFyoENmBZGNXoBbzBwCmC413HVRatuitwdH7t7SRGxc/FDJsBkVU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755525344; c=relaxed/simple; bh=CVe0bCzVPUvSpXZlqFdAl7A1B8+ZXdkRC1xGyqP8h5k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RtlLbuSu9zix79KYN1DOOHkBFG0h79/Tns2yWoL7iirOPnP0VBB1pzxRYQCi6PJlDFvGthRSDSZGd6V2uvgoGHOd+lzEN08W2A+zK9QRjybzvBc6suoAxFW5nekdSSpiXFxDa+IbZfKt2PHZZrQXj9u8YHKggFh3mrzx42gN6TI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cOe0rv1B; 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="cOe0rv1B" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E8C5C4CEF1; Mon, 18 Aug 2025 13:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755525343; bh=CVe0bCzVPUvSpXZlqFdAl7A1B8+ZXdkRC1xGyqP8h5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cOe0rv1B4R3a3Y4QRAFsLgvSJQLstj3XS++XfF9vSZdINjD/QkgeFD462xXRVkWxs dxJNLuNDyTfKofc6yuG2D3q5KLt3eJtnUN3smaEGMXCihZ1tjgAIei4cMi6mbE5Epx SBaCaObzr0qByWYICsRGGMsTBn4nn7cdal7Or+50= 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.16 232/570] net/mlx5e: Properly access RCU protected qdisc_sleeping variable Date: Mon, 18 Aug 2025 14:43:39 +0200 Message-ID: <20250818124514.767112186@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124505.781598737@linuxfoundation.org> References: <20250818124505.781598737@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.16-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