Re: [PATCH v2 1/2] net: usb: cdc_ncm: add ndpoffset to NDP16 nframes bounds check
From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-03-12 01:53:21
Also in:
linux-usb
From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-03-12 01:53:21
Also in:
linux-usb
On Mon, 9 Mar 2026 13:34:48 -0700 tobgaertner wrote:
From: tobgaertner <redacted>
the From line should match your SoB tag You probably need to commit --amend --reset-author
- if ((sizeof(struct usb_cdc_ncm_ndp16) +
- ret * (sizeof(struct usb_cdc_ncm_dpe16))) > skb_in->len) {
+ if (ndpoffset + struct_size_t(struct usb_cdc_ncm_ndp16,
+ dpe16, ret) > skb_in->len) {
netif_dbg(dev, rx_err, dev->net, "Invalid nframes = %d\n", ret);nit: maybe save the size of the struct to a temp variable? To avoid the awkward line wrap