🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25811

Re: [PATCH net v4] ice: fix Tx hang dump using stale tx_buf[0].skb

#25811
From: Matt Fleming
Date: Wed, 02 Dec 2026 13:36
69 lines
14817 bytes
On Thu, Nov 12, 2026 at 01:45:56PM -0500, Vincent Choiniere via B4 Relay wrote:
> From: Vincent Choiniere <choiniere.vincent@hydroquebec.com>
> 
> ice_tx_hang_reporter_dump() always reads tx_ring->tx_buf[0].skb,
> regardless of next_to_clean. The Tx cleanup path frees the skb and
> marks the buffer empty without clearing the skb pointer, so slot 0 can
> hold a stale pointer. A NULL check alone does not cover this, and
> devlink_fmsg_dump_skb() can fault on the freed skb.
> 
> Using tx_buf[next_to_clean] alone does not fix the lifetime issues.
> The dump runs from the service task without synchronization with Tx
> cleanup or ring replacement:
> 
> - ice_clean_tx_irq() can free the skb at next_to_clean while the
>   report is being prepared. It calls napi_consume_skb() before
>   marking the buffer empty.
> - The ring saved by ice_tx_timeout() can be replaced or freed before
>   the service task runs. ethtool -G replaces the ring contents and
>   frees tx_buf and desc, while ethtool -L can free whole rings.
> 
> Record the queue index, next_to_clean and next_to_use at timeout time.
> Before reporting, take RTNL and check that the timeout was on the PF
> VSI, that the VSI is up and that the timed-out queue still maps to the
> saved ring. A freed ring can be reused for another queue, so a pointer
> match alone is not enough. Copy the descriptors and IRQ name while the
> ring storage is protected against replacement. If the check fails or
> the copy cannot be made, report only the values recorded at timeout
> time.
> 
> As before this patch, a successful snapshot shows the ring when the
> report is generated. A reset of the same queue after the timeout, for
> example by ethtool -G or an MTU change, is not detected.
> 
> Tx cleanup can still run while the ring state is copied, so do not
> dereference the skb. Retain only its pointer value in the dump and
> remove the skb contents.
> 
> Release RTNL before calling devlink_health_report(), which takes the
> devlink instance lock. Build the dump from the copied data and free
> the descriptor copy after reporting.
> 
> This leaves devlink_fmsg_dump_skb() without users; its removal is left
> to a net-next follow-up.
> 
> Observed on an E810 PF passed through to a KVM guest with Ubuntu
> kernel 7.0.0-14 (PREEMPT_RT and a local scheduler patch): a delayed
> queue IRQ led to a Tx timeout and a page fault in
> devlink_fmsg_dump_skb():
> 
>  BUG: unable to handle page fault for address: 0000000004cd0c11
>  Workqueue: ice ice_service_task [ice]
>  RIP: devlink_fmsg_dump_skb+0x2d8/0x5d0
>  Call Trace:
>   ice_tx_hang_reporter_dump+0x1ce/0x210 [ice]
>   devlink_health_do_dump+0xcc/0x190
>   devlink_health_report+0x1d7/0x260
>   ice_report_tx_hang+0x7d/0xa0 [ice]
> 
> Fixes: 2a82874a3b7b ("ice: add Tx hang devlink health reporter")
> Link: https://lore.kernel.org/all/20260327072332.130320-1-aleksandr.loktionov@intel.com/
> Cc: stable@vger.kernel.org
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Vincent Choiniere <choiniere.vincent@hydroquebec.com>

FYI we've been running this patch at Cloudflare for nearly 3 weeks and
it seems to resolve the crashes we've been seeing during tx timeout.

Tested-by: Matt Fleming <mfleming@cloudflare.com>
Technical Details
Message-ID: <awg6SPDYG8JmfzHT@matt-Precision-5490>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375814-linux-kernel-netdev=dewy.ru
References: <20261112-ice-tx-hang-dump-v4-1-9125f687669b@hydroquebec.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375814-linux-kernel-netdev=dewy.ru
From: matt@readmodwrite.com (Matt Fleming)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v4] ice: fix Tx hang dump using stale tx_buf[0].skb
Date: Wed, 2 Dec 2026 13:36:36 +0000
Organization: Usenet Network
Message-ID: <awg6SPDYG8JmfzHT@matt-Precision-5490>
References: <20261112-ice-tx-hang-dump-v4-1-9125f687669b@hydroquebec.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="1981251"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:OLZpX8cy3Z/jv0iOzOzXlR5WBOE= sha256:dwO5SoWp8gB9pbLXK+LS4ia0sAIxXd1ZEXhcDjhYtCY=
	sha1:4TPy7A14tYRGmErqxK51sEcehOA= sha256:YyyFOJN+NnTgMcteDCGOp6jT2hEc9iULV53QiZ639LU=
Content-Disposition: inline
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 A2E2211762E; Wed,  2 Dec 2026 16:37:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.951
X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=readmodwrite-com.20260707.gappssmtp.com
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 unGFxbhm9dBm;
	Wed,  2 Dec 2026 16:36:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375814-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=readmodwrite.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 5094B1175F0; Wed,  2 Dec 2026 16:36:51 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 9A0052812B; Wed,  2 Dec 2026 13:36:46 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796218606;
	b=IE18QJLOL7iwc+IuCOnt/gsB0r0RFrUBqB052xaD9z8Cmu8nq/itOPSMHXEyhtEVx9zF
	 7ULNM2wGjuRCTywiszN7vlPYHo4+xoDZ8l1qtkJNUPr6zPKKaBYNEEkn2CKowYwAptFIL
	 ePeAHEL1AZ9ProwO0QaeyXHSHbpew55loDBp0By4L9ray24H+SXF+pxu0ZG6EbOkqzBmQ
	 e+bYVzjq8q8cIoeDUv7tcjPNq6Fo6dZc8/jihOM9CHXqhtIYxxqW/ceCgw3AXvFU8i0dL
	 yc0J64hXZUlFNS9YQzZXP6ArDT2DUIr7PW/LeADCJRIRuQw/gFHQolO/ZfDfShQ9ETg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796218606;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:Date:From:To:Cc:Subject:Message-ID:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Disposition:In-Reply-To;
	bh=cDrY9RrD7l+aoZCUYJRwDoviHR8zfgBTJfRp4mKnrwo=;
	b=M2XKKmMAKsYu8eIXpb1QhhFnC7ZFomlmtlYndLXzgvdjOiarmM8dPh8JCh4xABck4O2J
	 0K/yKq2ahk94SobVUcg4rA4NS32SclSHKRze9/gK5HxGyuyS8MmdMcwan+rWLeyhERNYF
	 Tmp8v0jyJH+oDXUUNUTWxWXmamKfrmAur7wJfjhVuBGN7gX+t1Gop0AISCDzKgBAs3Gag
	 9KZ1UvPSJfQ8LlsypCYhf5XDWHnNBTurVNsWM++ZOoQctCK/f5dJ4SzKtEt3qEJ5GNjEW
	 FyzPTsFxpkScMAQ+z7qMLP3dSJ7nwR3VPS/j2UFpxEi1g+deKHMX7Qi8nIGYXQxb2TQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=readmodwrite-com.20260707.gappssmtp.com header.i=@readmodwrite-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=d65WfUaw;
	dmarc=none header.from=readmodwrite.com;
	spf=none smtp.mailfrom=readmodwrite.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 71DF2606A32D;
	Wed,  2 Dec 2026 13:36:46 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=readmodwrite-com.20260707.gappssmtp.com header.i=@readmodwrite-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=d65WfUaw
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.47
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796218600;
	b=DUZZhKIjyZhLVlv7APud6LGT1U1Gp/KHY1zR+WqCv69wnes9A7P10YxSDxiP2FHPZmN4
	 Ri72XPD56AvN7j+CLqZgnQD49buTCeFozvJJ/7K9j2tEaK7YVOHj18RvdTmjPVKUysRh0
	 MmbdghRJZEs/PWW4fk+Wvky/kbBndQ9/GBscsmz80pdcJ6PQ/NCcUXp9JV8IGhSHcXCXz
	 yiZw0XqulOxn+X9k3yRK7SiekyrAeRl45bObksQR4GnQpQ2b5PM/b1H/d+vmzIVeQolMH
	 InGzp4gY8Lo9pB5WMgQb++porAzU9rdXOBr2DAXcM0IB2wzgrX+0BDHzPl3/uOgMr/w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796218600;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To;
	bh=cDrY9RrD7l+aoZCUYJRwDoviHR8zfgBTJfRp4mKnrwo=;
	b=Zor8a9JGTF/T4AGu9uIqc8YYVgDcN1V9wjHcDWTnFJWSoP0cRYicgOq8/cKs0GEI52S/
	 Yg3eQDRhIbyZd8hDOtGZErwGmBWnRdOiE5DJp23VwGPIT7GCwZoOzU0WoN/2QGDyNEHVk
	 eKGs4n7eVXsFUGGBr5wSTZXVzeIpvS8V9k5C08JXFjGCb0g7zVQ47LUdmduf8xnX/M849
	 Il5ZS2BIO/CHj8UiO0MJCIcTfSATIv+kikRa4yCvpg9ecWsxcwi26/7X+RAZ/AdyCByXk
	 ZbOe/gtPcR8qkR0ClFJCJ7mFTZpvzFxbytwDQeauZGXlULt2LoKLcNajKnNniCMofIw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=readmodwrite.com;
	spf=none smtp.mailfrom=readmodwrite.com;
	dkim=pass header.d=readmodwrite-com.20260707.gappssmtp.com header.i=@readmodwrite-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=d65WfUaw;
	arc=none smtp.remote-ip=209.85.218.47
X-Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C2A6606A32A
	for <netdev@vger.kernel.org>; Wed,  2 Dec 2026 13:36:40 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3C2A6606A32A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=readmodwrite.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=readmodwrite.com
X-Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-c4395d31228so2283795166b.1
        for <netdev@vger.kernel.org>; Wed, 02 Dec 2026 05:36:39 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=readmodwrite-com.20260707.gappssmtp.com; s=20260707; t=1796218599; x=1796823399; darn=vger.kernel.org;
        h=in-reply-to:content-disposition:content-type:mime-version
         :references:message-id:subject:cc:to:from:date:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=cDrY9RrD7l+aoZCUYJRwDoviHR8zfgBTJfRp4mKnrwo=;
        b=d65WfUaw5SZTqPSHgCA0B9qAszv1ZLMCbxy82GVouKyF+hebXfhCPdzvM+GmTnSRrG
         9Noke1Y5m2SA1LUMaFeWcCuFnWPuDOKZ8HojaKXWiLteWuNDe+n5Yvkb+XtgB3ORMqIB
         qb5kV03RypPfyBXlz2ZTDcVymjLsVkJnfZlbzXg9reJL5Ld98fwRmnMmLeIFMywsNSmT
         STmPthIAfIXd2WY0E7PKNKM8jiZIVFXl8BFgJ7M886JP2NzInqqZP/Gz7hrfc+b8E7G+
         3UOCqgrYyjpLfjmqUD4HZFUiNg/IKRiCeXQAAGnl1bgjQM5znUAWrnIIvmc/Hm8K2Wdx
         28NQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796218599; x=1796823399;
        h=in-reply-to:content-disposition:content-type:mime-version
         :references:message-id:subject:cc:to:from:date:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=cDrY9RrD7l+aoZCUYJRwDoviHR8zfgBTJfRp4mKnrwo=;
        b=u0gJHETgQKXsOgNRWem6/d/4fhp1Fn+PZ1aXorlYPLMLpC5htmKu9cyhiUuweew/RI
         hBGVNB+jXIMBS8nju5HsoZK8y3xdJ+Zl7uoXjRLzv6sFOZwCdO0YCtDkcYnEm2g2Ou9Y
         CnLn6T4pPA+tYbE14nLm5+eX48JROWn2/3Nq9K9RQbGWMEgIdM2ttjW2wnAsFaGJUL7C
         kPz+UfDeQMRTfjCrrqTk3enfrlQDFpX42RfLUd/MY4OYA5hJ9qWsMbdnzApNDKaiHQ+9
         laiKCnhQLq4f/0opLw7byFmA6Q71uUHmkFNJ/DKIqhpvRqnfKseT9qeyoJIBikVReE80
         Nzdw==
X-Forwarded-Encrypted: i=1; AL+hErEf+MHYAtqIqozSaumP9TTLwrLtluyGHFbB7W1PPiBaKFgqnCCkijT6sVkqgxW/9a/8E1HbNBU=@vger.kernel.org
X-Gm-Message-State: APuU4Z/RgGAhz2XtU/HEHsQLdFvVRL7yl3DDxP5eAZqY3dJGVr+UihUH
	+t0NAc6WS97f32gUS/jxP/DrPu4qAe0iYM4oL0cD0O0GUp/5ock8CdJ9T5BuCRfa/GU=
X-Gm-Gg: AZFdTZcxSPebGvzgEZ5ak9Nd0F1K1wxkTLS8Z4uFsJdXoAc/PuJbaTHXjHZPeo4djl4
	0GJgZICDYbtGCBFfsgK/XDLXWU6JpB5jCFBMTyA7nqK/C9YTol4ZP/5lC6oEuJdSLDSFGBY8cx/
	OAMN8YP2DWoiNVih/u8NpL0k8yVmKQ8noVEC0/aqhBW7txAoi6JkzkXXxuh7leUUD29f/uIK5/A
	GjwCx9cYuyVQyncZJvFTbM9CoRf+VPAPd1ebljPzRO9MZre47O1+b1VuWZliGfmKco6bPH4MwsP
	XRYm7WWFjazoiA5kaLbZtEv2XfFNa7eLfhjnCUDyVggkuXquw9MqgqKW7x/3rgMyLgOp7Ouk6MO
	SSLBPTj/5GXx1U5RbPQ3NOn0yuNb4u3VXz1mdETyETf6m0cJfYiphyaOkmMjJVjjCOVGvwSMhRT
	+bEP7r+H8v9wwz47BgT6RT6Pl5NBQtnZ6vGMygipkflAbHxvoa0dPpSiQmlJEt02BpvrZFfz3fO
	FrkOM/u2PV1UJIjSCi+3i8qwFlOqdEwpazg4TQ5JSWh9z+WYMc5OxNccf4uwTQCC/Kn9PH+aLOn
	OUnbSQe0G0I9RQ==
X-Received: by 2002:a17:906:29db:b0:c4c:eb16:4014 with SMTP id a640c23a62f3a-c513a3a0107mr2978018066b.1.1796218598521;
        Wed, 02 Dec 2026 05:36:38 -0800 (PST)
X-Received: from localhost ([2a09:bac6:37a8:3a1e::5ca:24])
        by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513ae8d0dbsm1357033266b.31.2026.12.02.05.36.37
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 02 Dec 2026 05:36:37 -0800 (PST)
X-Cc: Tony Nguyen <anthony.l.nguyen@intel.com>, 
	Przemek Kitszel <przemyslaw.kitszel@intel.com>, intel-wired-lan@lists.osuosl.org, 
	Aleksandr Loktionov <aleksandr.loktionov@intel.com>, Michal Kubiak <michal.kubiak@intel.com>, 
	Wojciech Drewek <wojciech.drewek@intel.com>, Mateusz Polchlopek <mateusz.polchlopek@intel.com>, 
	Paul Menzel <pmenzel@molgen.mpg.de>, Andrew Lunn <andrew+netdev@lunn.ch>, 
	"David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, 
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org, 
	linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@cloudflare.com
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261112-ice-tx-hang-dump-v4-1-9125f687669b@hydroquebec.com>