usbnet: ipheth: check that DPE points past NCM header
authorFoster Snowhill <forst@pen.gy>
Sat, 25 Jan 2025 23:54:04 +0000 (00:54 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 28 Jan 2025 11:16:32 +0000 (12:16 +0100)
commit429fa68b58cefb9aa9de27e4089637298b46b757
tree35d06042819c9ed37ba78f09baf2484ad5f2758d
parentc219427ed296f94bb4b91d08626776dc7719ee27
usbnet: ipheth: check that DPE points past NCM header

By definition, a DPE points at the start of a network frame/datagram.
Thus it makes no sense for it to point at anything that's part of the
NCM header. It is not a security issue, but merely an indication of
a malformed DPE.

Enforce that all DPEs point at the data portion of the URB, past the
NCM header.

Fixes: a2d274c62e44 ("usbnet: ipheth: add CDC NCM support")
Cc: stable@vger.kernel.org
Signed-off-by: Foster Snowhill <forst@pen.gy>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/usb/ipheth.c