Re: [PATCH v2 net] net: ax25: fix integer overflow in ax25_rx_fragment()
David Laight <[email protected]> Sun, 12 Apr 2026 22:05:50 +0100
| Newsgroups | org.kernel.vger.linux-hams,org.kernel.vger.linux-kernel,org.kernel.vger.netdev,org.kernel.vger.stable |
|---|---|
| Message-ID | <20260412220550.0f35f5ef@pumpkin> |
On Sun, 12 Apr 2026 13:17:51 -0700 Jakub Kicinski <[email protected]> wrote: > On Thu, 9 Apr 2026 10:50:26 +0800 Mashiro Chen wrote: > > Fix mirrors the identical bug fixed in NET/ROM (nr_in.c): check for > > overflow before adding skb->len to fraglen, and abort fragment > > reassembly cleanly if the limit would be exceeded. > > Same problem as reported by Simon on the netrom patch applies here. > > nit: I don't think you need to cast ax25->fraglen to unsigned int > in the comparison. since it's added with skb->len it should get > auto-prompted to unsigned int. It wouldn't matter if that comparison were signed. Or change the type of ax25->fraglen to be 32bits and do the sanity check for overlong packets later in the code. I had a quick look at the header and the structure hasn't been size-optimised... David