[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADEc0q6iLdpwYsyGAwH4qzST8G7asjdqgR6+ymXMy1k0wRwhNQ@mail.gmail.com>
Date: Tue, 18 Nov 2025 20:57:59 +0800
From: Jiefeng <jiefeng.z.zhang@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, davem@...emloft.net, pabeni@...hat.com,
andrew+netdev@...n.ch, edumazet@...gle.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: atlantic: fix fragment overflow handling in RX path
I have used git send-email to send my code.
As for the patch --The aquantia/atlantic driver supports a maximum of
AQ_CFG_SKB_FRAGS_MAX (32U) fragments, while the kernel limits the
maximum number of fragments to MAX_SKB_FRAGS (17).
Jakub Kicinski <kuba@...nel.org> 于2025年11月18日周二 08:42写道:
>
> On Mon, 17 Nov 2025 19:38:54 +0800 Jiefeng wrote:
> > From f78a25e62b4a0155beee0449536ba419feeddb75 Mon Sep 17 00:00:00 2001
> > From: Jiefeng Zhang <jiefeng.z.zhang@...il.com>
> > Date: Mon, 17 Nov 2025 16:17:37 +0800
> > Subject: [PATCH] net: atlantic: fix fragment overflow handling in RX path
> >
> > The atlantic driver can receive packets with more than MAX_SKB_FRAGS (17)
> > fragments when handling large multi-descriptor packets. This causes an
> > out-of-bounds write in skb_add_rx_frag_netmem() leading to kernel panic.
> >
> > The issue occurs because the driver doesn't check the total number of
> > fragments before calling skb_add_rx_frag(). When a packet requires more
> > than MAX_SKB_FRAGS fragments, the fragment index exceeds the array bounds.
> >
> > Add a check in __aq_ring_rx_clean() to ensure the total number of fragments
> > (including the initial header fragment and subsequent descriptor fragments)
> > does not exceed MAX_SKB_FRAGS. If it does, drop the packet gracefully
> > and increment the error counter.
>
> This submissions is not formatted correctly. Use git or b4 to send your
> code. Please also make sure you read:
> https://www.kernel.org/doc/html/next/process/maintainer-netdev.html
>
> As for the patch -- what's the frag size the driver uses? If it's
> larger than max_mtu / 16 the overflow is impossible.
Powered by blists - more mailing lists