🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #3974

Re: [PATCH net] net/mlx5e: Fix NULL deref in PTP TX timestamp recovery warn

#3974
From: Vadim Fedorenko
Date: Fri, 16 Oct 2026 12:17
34 lines
7518 bytes
On 15/10/2026 09:02, Tariq Toukan wrote:
> From: Carolina Jubran <cjubran@nvidia.com>
> 
> PTP SQs are allocated via mlx5e_ptp_alloc_txqsq(), which never sets
> sq->channel. The excessive port timestamp delta recovery path
> incorrectly used sq->channel->netdev for netdev_warn(), causing a NULL
> pointer dereference. Use sq->netdev instead.
> 
> Fixes: 391dad2e686f ("net/mlx5e: Recover SQ on excessive PTP TX timestamp delta")
> Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
> Reviewed-by: Alex Lazar <alazar@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
> ---
>   drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
> index 723f66a6bd63..2e1c3bb5a959 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
> @@ -98,7 +98,7 @@ static void mlx5e_skb_cb_hwtstamp_tx(struct sk_buff *skb,
>   		ptpsq->cq_stats->abort_abs_diff_ns += diff;
>   		if (diff > (NSEC_PER_SEC >> 1) &&
>   		    !test_and_set_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state)) {
> -			netdev_warn(sq->channel->netdev,
> +			netdev_warn(sq->netdev,
>   				    "PTP TX timestamp difference between CQE and port exceeds threshold: %lld ns, recovering SQ %u\n",
>   				    (s64)diff, sq->sqn);
>   			queue_work(sq->priv->wq, &ptpsq->report_unhealthy_work);
> 
> base-commit: 513444cc62e231a11c9b15ea88de0890da9b2b4f

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Technical Details
Message-ID: <4a0d6901-0099-4d49-b9a2-97b09cd6418a@linux.dev>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347322-linux-kernel-netdev=dewy.ru
References: <20261015080218.1102172-1-tariqt@nvidia.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347322-linux-kernel-netdev=dewy.ru
From: vadim.fedorenko@linux.dev (Vadim Fedorenko)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net/mlx5e: Fix NULL deref in PTP TX timestamp
 recovery warn
Date: Fri, 16 Oct 2026 13:17:20 +0100
Organization: Usenet Network
Message-ID: <4a0d6901-0099-4d49-b9a2-97b09cd6418a@linux.dev>
References: <20261015080218.1102172-1-tariqt@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2759589"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:HIO5N0JCx+pvREAsBplNbuNId0A= sha256:P6SmBCxoR8xRLQZL42TE+ZzvcIpKDbsZXAohIjPextg=
	sha1:SEr7DmcJIVEQT3oz7pOwCbqZvus= sha256:zvK0EhKEfm0m4Aotd5Aqrjny7v3GTZijFfZPPoElJmo=
Content-Language: en-US
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 0C78A110517; Fri, 16 Oct 2026 15:19:56 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.75
X-Spam-Status: No, score=-0.75 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.dev
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id HZyQke3ZiFEQ;
	Fri, 16 Oct 2026 15:19:53 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-347322-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id A03771104F9; Fri, 16 Oct 2026 15:19:44 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id 4513C330D2; Fri, 16 Oct 2026 12:17:30 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A57447799D;
	Fri, 16 Oct 2026 12:17:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="PZJvz83r"
X-Received: from mta0.migadu.com (out-10.mta0.migadu.com [91.218.175.10])
	(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 984C0473C6D
	for <netdev@vger.kernel.org>; Fri, 16 Oct 2026 12:17:27 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.10
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792153049; cv=none; b=ith5uxajblPTZ6mC/IwMci/DKnEdht/9rPUV78XkoenEAVzBmO7edng+hiYzopu7C59qwUkm/PMDMkiAMD/SDCrttuUC0qOSlFbCP9XHdaRFxsB1Ysia0Fy1tiHNcZAywyUnf1hmuC6Enq8u8FKutmOaogpNZcEJCwFmYu6FAxc=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792153049; c=relaxed/simple;
	bh=DAem93gFc4FtDkc44LklFXhKCt1vx53adKVHzsaWu54=;
	h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
	 In-Reply-To:Content-Type; b=azra0/CBJOp/fca6aDR/epJ2p+7bVkI8/VZyfYIBTQ30rsF5YHZvTSuPaybA98XoS4Xni6Hu6JjlboOtQnnk4EmGUC4Bjx9NZYQaC8LyIMyXU+UhjHH6H4cxYJaYMaK4zinr6/OGZ4RgXO/8QA0Q4Tv7NcNLkhhUyjpV/7oNkSg=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=PZJvz83r; arc=none smtp.client-ip=91.218.175.10
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=DAem93gFc4FtDkc44LklFXhKCt1vx53adKVHzsaWu54=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1792153045; v=1; x=1792757845;
 b=PZJvz83r2V3YeZ/o4oAdHShzAHJPBcjDDefi1NVu3SDBl0G0sTRI/18ZqtZ0B+pLj1DKMgPQ
 5LFhwMUu4SpCqQCbLw/ZUngkz+31kQBobHXT8/S26xCmjGMcSYZoDxsCE3KroGWpCReRcjxnWok
 5FjAV0GO3NUfJI81B8fwGJuc=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by smtp.migadu.com with ESMTPS id d90c56671d5fcd56;
	Fri, 16 Oct 2026 12:17:24 +0000
X-Mizu-Trace-ID: d90c56671d5fcd56
X-Migadu-Flow: FLOW_OUT
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-User-Agent: Mozilla Thunderbird
X-Cc: Alex Lazar <alazar@nvidia.com>, Carolina Jubran <cjubran@nvidia.com>,
 Cosmin Ratiu <cratiu@nvidia.com>, Dragos Tatulea <dtatulea@nvidia.com>,
 Gal Pressman <gal@nvidia.com>, Kees Cook <kees@kernel.org>,
 Leon Romanovsky <leon@kernel.org>, open list <linux-kernel@vger.kernel.org>,
 linux-rdma@vger.kernel.org, Mark Bloch <mbloch@nvidia.com>,
 Richard Cochran <richardcochran@gmail.com>,
 Saeed Mahameed <saeedm@nvidia.com>, Shahar Shitrit <shshitrit@nvidia.com>
X-In-Reply-To: <20261015080218.1102172-1-tariqt@nvidia.com>