From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.47 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== 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== 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 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 ; Wed, 2 Dec 2026 13:36:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3C2A6606A32A 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-f47.google.com with SMTP id a640c23a62f3a-c4395d31228so2283795166b.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=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) 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: netdev@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