From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796218600; b=S6dnW/zgH82D4/XmeRde2JAkMLW7F3MvaOMsvdSm1Tg0OHNZ+MIFzGceIqJdjIcJ+De2 3si90QZjpR8WSDUd6YshH6T4TJwD2YpjXdefg0V2lthJPR90fu68lu5Eqeid/pbOeCuOw lpy5GL7As6d9OMVb8eS2h59yPJ7FofwhMMPgUEKsQLQxYcEQ0He7xjUtimtanY0SVFdHX 9Vxs8bdWmroCCYLubA+xCQYF/aQaeJh3uDGdlia1hMJWzT6KghzvELPRoN8zoso8WOUbz ty35+Xid3OHTPTakgtSha0wqY2PX1fPu0QWnM0QT0tOGvPYtxuLNl/G1DJPWBSuyw8g== 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=Gh2kjW4eB3LkPvQ2u7OyDtfwjPdVH8ZQbmk77lfjqhcpzIF+JhtVPwuxm1v1nOUnk0L0 LXswKp54b2lzefzUIMItW/i6pnn/MxV2FhUJTKkjL0M6iNhNjvIGTeuTxU+prTEbWSuKV lNcsHFjqzY43DCf18k972rj0BUVpfJuMZFF6FAio86NKMWSqPXZopnXExy44BfufAVVsQ D8FsYVfiV854hMzNiQcuQEP7G+pF5xTChJmtGRcmJy43mcXqqu01Ar08bRzVcLgY6hNKC P0ah/iEdATjLXH6Xz/xvkIZ9wsmwV2+MqZd3qQZfRS4zVCH/yJYbrBdfLduVVIegg0A== 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.46 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 42F6A606A32F for ; Wed, 2 Dec 2026 13:36:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 42F6A606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=readmodwrite.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=readmodwrite.com 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 Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-c4395d31228so2283794766b.1 for ; Wed, 02 Dec 2026 05:36:39 -0800 (PST) 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=amaQEAsUsLfbx6fEm0U8mW8tjdd6iWHoHLx/jKyUoP1vqtUwGJLHtu9TwR5SFXGF+1 aqos8/0XQ5aif+r5tl+IZoyWd5b+5LIGJX/EUA02YxUaeFq0HhF/gsl4PQ8qq37JKkaR uFdUSMyZ/3/sDJLFRtqj89ZJSiMlnHV9ZNhCQvSCY1QeoT06haJrkA6crITOJp1d6ijA G5hASXqlV9QGtH2UTj4+9pIP2iLjlNeWBZir7mFPkVrmcnXecFdWYot4CPPbuNOt+Svj frP8ZYZc5oXITX2hQJ3cDqoo+52hKCalxUb7wjXnLrsjltZ0ZVyNvVKW4yI5Mhdu5Kej Il+g== X-Forwarded-Encrypted: i=1; AL+hErE0TlOnxzwRHY+Yfm+NA+pGUWSVra2Eg6hOq8ZsUuH1QUl6P1JyFZdYgVh2Bah0EbMgXjLWSsSjFiD6l5A=@vger.kernel.org X-Gm-Message-State: APuU4Z9bKM07nh79FGD9grNGF5DZeqhNauwIi8qmkgXkKkanwwS8TB9r o07DbNycR253gafUwROsJnLoSFz18LvyU7fk+N0Ds442nx7aVWQ3nMuRx8/l8BarzLE= X-Gm-Gg: AZFdTZduMpwZ0MqZf7Rn/sDNpDcc8FfXd3csQck0M9ql8IxRV3FIkzXCxXlmf/suAT4 +l2GqyAbPGdr//egdXdL9/Z7rZOh9ZDkbAhGLmqoMLjIkgl5SQTKQ93OaHOwF2D8rRcJHgLlCUd 8kqSBdvpdelytFxXX6IoNK5UdDZhFqt1o+QN0DgHRSnkgUtZpISjlEQ4PhkOqlcm3M5P41M7hv0 knge32dGp+4X5n+uVFaJ3H62Yvqz6T9vwA+XQg9qeOEBAa8s/lL2+dUZlk/eQPl3Q3vChfM23xJ QA7BkI1/ylfcf+FXMRImXdHcYF9W+gUYmSBg20ilZ0sm3LJkrvxE3b1bOPPkocSgrvkED0druhG EP1m1V03kmLoZIdevo+G26oRU8RkoXFcGD6d1Ol0vwOQ7dYZ4HMN7Nt6bBcccCV7piqWk5rUTUd 6WMgGByxKTI4dTk08LpqBw7qJKyMrKsSzImBTKCnVRrG5BnHA5uHzm/73CFYyRaPqdt4WvrlmQ6 2QnxRF6sA3j/jM4+YhXcZYd0KHuXwcsR6Tkt9JsL9TqG104/cfpL5uadhN0hEiiYjEqDdfPVsz6 ktniiQWK/jb8WA== 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) 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) Date: Wed, 2 Dec 2026 13:36:36 +0000 From: Matt Fleming To: choiniere.vincent@hydroquebec.com Cc: Tony Nguyen , Przemek Kitszel , intel-wired-lan@lists.osuosl.org, Aleksandr Loktionov , Michal Kubiak , Wojciech Drewek , Mateusz Polchlopek , Paul Menzel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@cloudflare.com Subject: Re: [PATCH net v4] ice: fix Tx hang dump using stale tx_buf[0].skb Message-ID: References: <20261112-ice-tx-hang-dump-v4-1-9125f687669b@hydroquebec.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261112-ice-tx-hang-dump-v4-1-9125f687669b@hydroquebec.com> On Thu, Nov 12, 2026 at 01:45:56PM -0500, Vincent Choiniere via B4 Relay wrote: > From: Vincent Choiniere > > 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 > Signed-off-by: Vincent Choiniere 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