From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (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 04A981547E7 for ; Sat, 22 Nov 2025 01:36:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763775403; cv=none; b=Uzt54gMrlMWRFop4w0w4Nj+KlmDtKQgMRLSRh4gQBuAnOLY+tbJMSr77HgEK6BqPM/LJywf6dCW9NMBKjxhUiG+ccnDn/R2oyi/ZlncZfwyTGHopMhPslHLyMgRZCivkMJE5KHQtOdslPoW9zgdnVRy4CHtst8u4Vawa3+rPfGk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763775403; c=relaxed/simple; bh=lSIKeSSdN0SBBxsZ4+EzfR7j4n/zPOL+lRRertv0kLQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RN7AfDUSwNlWcCd2oEfFdjuAijAPFopAZq14OgU+tX1amVBZ0h0ZyKtXgxRRm9+bpsQDdV9ml/JK5v3w2+bFgpRgczefsxZL9cO8npa0iPWrjoy/2in83ID/Bocw3AszBzAtxJq3x/HzFUrphqLOaJNGwklgjQt9qFVqJ8OFm9s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OKLVZDBk; arc=none smtp.client-ip=209.85.128.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OKLVZDBk" Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-78a7af9fe4fso28598797b3.2 for ; Fri, 21 Nov 2025 17:36:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763775401; x=1764380201; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lSIKeSSdN0SBBxsZ4+EzfR7j4n/zPOL+lRRertv0kLQ=; b=OKLVZDBkqubKwBh2WSy8yUObxbSd/X9NKONl9pYtKNRxIpIPHmH3TIjBT6044bYFDH 8ZFl009wSUcP/QYe7+A+Nu45jQ3B3J3wpE+mpSZ/4L96s2AMbws5gV5DCFzCIIQE1nQ6 s0YrPzE9WKe/9wV/IMOx8speEqBzKttUKPwmTMquXxxBb4edq1r7pfhRr9cEQaw10m1/ KPrksvpfqdclpSZ9QEaiQbuzE8r9t351KRChDfPh+WlgDiRn/Td8TUVqX/KC2dvYWOq+ dodn5hZSkdw1D+8ki6pfIj1kdtWGdFD1g0oVBlLRfCs9QVWKjt1JccReE9Ty5Z4M6n0n bM9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763775401; x=1764380201; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lSIKeSSdN0SBBxsZ4+EzfR7j4n/zPOL+lRRertv0kLQ=; b=NhewN/sYMi+6IrM+BtGWmhBG8uZhCP7b92A+S0T3OqTCWZdSxlak6L3PWSX3cnrInM s6Sz/9Nzhr6vnPQRszURaj2yovjoIZu5Vr0HBvltDLuNttM5yIhudpRJO/+WSSefZbi5 7XWwIKSENF8zk6oFOY2Z07yf2vK3TB3Hzo0M3ED5l8zRgCloGBHLaTLqjrBOad73cL+E WACtsOf8sRW+jDHm4WxeCfXFyk3aLY1eWVvr4LPTrJ0Oh/Ug6M1MXmmpO+fnsVQ8hABj TPOyUwxGT3ZeqEfV3loxTZhBNB/Je/AA45AXx1UO+6X12EMjuh6Xyrd5Bxj4OKg7f4YZ 58/g== X-Forwarded-Encrypted: i=1; AJvYcCXsIK+145AAsJoHlvPRSv4pgKcljI+A7qs7flf3nV8xeyiEibgizyOVNfuGEXko6jzLa3z6O2YlnDiCSjw=@vger.kernel.org X-Gm-Message-State: AOJu0YyMzIoLey91CgZOGvTSpHoLb2jUIgcWa2gz/aAKW1tnKpYJ5v5F ofxaYOUPivgro2G5x7qYDa/3+9JgNbEPrY6UBvUdZVGg1FX5H3+WPWrYFJYLB4ysiqSx95EFgYR uP4kYtRxI9Fw7qQeAlbvqvVkM3yILxKEbgi+j8FrecQ== X-Gm-Gg: ASbGncu8ODcLkbcGPQPpYKq8qtP6oxrW/9BYu7nyR/DnzJ8kCTlKP7a5wbzuFL/RyIV rJwZjMjn46nhfX6R/G8z3dVAVa4MdE0hJXPTXYFXjB1fHtzfyotVm9ozZPfc/PccqcfkZ+aU3vX zXe0MoRJNSuVnzSP9yQggbtXaTH60NPnXaljKwLZOENez0V1sKnfKnCfDEZlWLzEOLDrobSy+vM E8POaQE1jQ2KrVsep0DkoTUrCmhS1wWbnS3SBwoqaXMbAAKlKU3PO24rHVrQK2g+WApuNkd9n/r jrvUDK0= X-Google-Smtp-Source: AGHT+IEEcdXpW1Ky9zijzeuapP78vdemo3GsNAJC0YAo753LTJxCkEd//RTstJFeJ2xLGXeW1BCWyjmKKeZhiNoPUBw= X-Received: by 2002:a05:690e:1488:b0:63f:bc75:6ead with SMTP id 956f58d0204a3-64302a2f958mr3111193d50.9.1763775401006; Fri, 21 Nov 2025 17:36:41 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20251118070402.56150-1-jiefeng.z.zhang@gmail.com> <20251118122430.65cc5738@kernel.org> <20251119190333.398954bf@kernel.org> In-Reply-To: From: Jiefeng Date: Sat, 22 Nov 2025 09:36:29 +0800 X-Gm-Features: AWmQ_bmNfulo0Y3AhLxrzxVt3M2ENJKcudUeNbK9Mf1eC90GK2aeMW6Fd50qHYY Message-ID: Subject: Re: [PATCH net] net: atlantic: fix fragment overflow handling in RX path To: Jakub Kicinski Cc: netdev@vger.kernel.org, davem@davemloft.net, pabeni@redhat.com, andrew+netdev@lunn.ch, edumazet@google.com, linux-kernel@vger.kernel.org, irusskikh@marvell.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Nov 20, 2025 at 9:06=E2=80=AFPM Jiefeng = wrote: > > On Thu, Nov 20, 2025 at 11:03=E2=80=AFAM Jakub Kicinski = wrote: > > > > On Wed, 19 Nov 2025 16:38:13 +0800 Jiefeng wrote: > > > And I have encountered this crash in production with an > > > Aquantia(AQtion AQC113) 10G NIC[Antigua 10G]: > > > > Ah you're actually seeing a crash! Thanks a lot for the additional info= , > > I thought this is something you found with static code analysis! > > Please include the stack trace and more info in the commit message, > > makes it easier for others encountering the crash to compare. > > (Drop the timestamps from the crash lines, tho, it's not important) > > > > Thank you for the feedback! I've updated the patch to v2 based on your > suggestion to skip extracting the zeroth fragment when frag_cnt =3D=3D > MAX_SKB_FRAGS. > This approach is simpler and aligns with your comment that extracting the > zeroth fragment is just a performance optimization, not necessary for > correctness. > > I've also included the stack trace from production (without timestamps) i= n > the commit message: > > The fix adds a check to skip extracting the zeroth fragment when > frag_cnt =3D=3D MAX_SKB_FRAGS, preventing the fragment overflow. > > Please review the v2 patch. Hi, I've reconsidered the two approaches and I think fixing the existing check (assuming there will be an extra frag if buff->len > AQ_CFG_RX_HDR_SIZE) makes more sense. This approach: 1. Prevents the overflow earlier in the code path 2. Ensures data completeness (all fragments are accounted for) 3. Avoids potential data loss from skipping the zeroth fragment If you agree, I'll submit a v3 patch based on this approach. The fix will modify the existing check to include the potential zeroth fragment in the fragment count calculation. Please let me know if this approach is acceptable.