From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796218600; b=eI0bVZja/eG1n7LFfA/Oq3ywhT/XFit20dyDW8zXffxRX34HxLE5k4buMeUY7vPT1RKp LwZ14NDG02I4dOKH6feNWnxL0Cnm2Hnoz/gQ3TO7FK2QnATEbJou6Uvyq8VnONZCEnUpj /+cv/a9dz9qsCRcAbcJ7C1faDd2Jsea9xstSG2jWVOVnpKrm4VxLxsx25vMC2gFW2vEgn g6WNuECIsJ9CbxcRFgqWMfL+xNDwjwprrd7XESndt0atx+hFE1F3qVkr9S9E60WokVEV2 bP9UnDEuuHbe0DV0uTxfWIGTHpLEqPTrB/+BVJLZRfKp0KVxWrSVxehx7P5VQQhQ6mg== 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=b8ZPz8buMoBfVDqXkom9O9HfGlOEuLgWrkV0+tjSQT5QR7QzCsCL8x5LlEQHnc5tem91 yVZqk8kPzaKF2SaXMJsyl6AE3lb97Xrcf5tRPIAfTB7GS8KuLcprJH3DO5BLcOf510fp1 DvE2ClCq/VuFeIhpXVw3srGwnKH2/fnF9e+EmN9X8Nncrz4pwaqLojeUeZJv17nuhuaHF E7L6YG7i22GtzfdReenZZb6/WTzz0QDfHtFuS2MLLp/tcf6aAjSAhXwB4DWpWDcHhIz+Q VQjAkcl6VJEvVGrXWKXerYO9xLIxDasrC8B+VrxO0b48AaPtAPjVZCT4uwBEGQO6y+w== 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.45 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 45A9D606A330 for ; Wed, 2 Dec 2026 13:36:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 45A9D606A330 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, unprotected) 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-f45.google.com with SMTP id a640c23a62f3a-c51d158acc6so870272166b.0 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=o/SZIQGlkF/9JJ2RurwbdP+dQ+jbWr0MINUCqoVq4gheXKzfGmdy2ZozP3xr6jaTEg g3UBskmFnGZT4RkH9umq6EQmmw4I+8ZyBciPgEbt/pzKbkKxF9CSSnHZIbjZ4xY2mZJi hLNOYrhRIkvQRnzwcUnWVjlq8/ZWZMHN3TskwSMpjozVnvPoj49vhx2D3DzLbSRwWzVE yjDHbd4BM0MddDRGhv1nRCfJ1BA8IWr4B7OQwtCXKQ0LwdmXwOmLwCL+r4Zrvgb5ZPEf dN9is1aRf2/5TcQTAghfsiCHSYeXcXozhBrUTdkZ+b84qCkW5fXRuxyvIhwDMzGgJQDU sgAQ== X-Forwarded-Encrypted: i=1; AL+hErGCYUHKVytx3ZBNVGYzgUI1Urkg8p2D7S7GKa+n3okmcCutEAPOh9Djb2dK9I2lokZHih22XNA=@vger.kernel.org X-Gm-Message-State: APuU4Z8XyfpUVduqGU5R9ZbJWt3V31nm9tlDDrHQvHsM2Z15s8k+HZmK A8QvRR6ZN+D2rkb9vSm0lJyKVZPRHWVJNi5KiuXb8UofSi4YpsKrDwds5mNH/6+huIA= X-Gm-Gg: AZFdTZeuXhlMbZKaPvh5qNwMZPY2wbsYSuX/SZEmDfFgmznUYdJVEzOxgQJ0sQfEOp3 DtKpFdj8aJipCXR0EeU0csPmyTexBJSf1mM+S92mgh7aWDIIeTYG8NTFpLdou3Nqia2ogIabnth vfjPMUK7g8LD16muEmIlbUuzsobxYehQk/VNpeg9n9Wet56m1IoxMvaQdPcll7UE7Vh83t75iWr 1FG2oRIANqA0nS5z4xjhtHCRd0CIYmViXXB7uY7IQONs3gQcm5+JwVdRv3v4kH39nPoiWyYBUsA bLPT3YfH0zCBHd3x4oWuWWmkBIzyeD+7KzD1tgPWPK/ie8Oa88dCCSvXBSAtTVUqWUFMz8+sEHS dvjRxqyoBEdgzOF8wAamyRvCoS8Op60NOqslffq7pq8m5CEos/wEm2ieiSdBxxA3xB8/Zshq3xT 1Z+vFt9n8eQPMZuJrvdbC1l0Sb4v8fT0BL1y9cjNGMa8m6SDggXSoLGyopM5p1vm2fgpDvduVTN 5SrcMxKPMskqSI8/fLYoXXo22rZ1GxsGwkUFc3T3gXEWCSN7FjjskpZXq3pZ+t+tCNccGxMayD7 NOln/+b9anJbpg== 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: stable@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