svn commit: r290609 - stable/8/sys/dev/usb/net
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Nov 9 11:29:56 UTC 2015
Author: hselasky
Date: Mon Nov 9 11:29:54 2015
New Revision: 290609
URL: https://svnweb.freebsd.org/changeset/base/290609
Log:
MFC r290441:
Fix for unaligned IP-header.
The mbuf length fields must be set before m_adj() is called else
m_adj() will not always adjust the mbuf and an unaligned read
exception can trigger inside the network stack. This can happen on
platforms where unaligned reads are not supported. Adjust a length
check to include the 2-byte ethernet alignment while at it.
Modified:
stable/8/sys/dev/usb/net/if_cdce.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/dev/ (props changed)
stable/8/sys/dev/usb/ (props changed)
Modified: stable/8/sys/dev/usb/net/if_cdce.c
==============================================================================
--- stable/8/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:27:31 2015 (r290608)
+++ stable/8/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:29:54 2015 (r290609)
@@ -1381,6 +1381,7 @@ cdce_ncm_bulk_read_callback(struct usb_x
/* check if we have a buffer */
if (m) {
+ m->m_len = m->m_pkthdr.len = temp + ETHER_ALIGN;
m_adj(m, ETHER_ALIGN);
usbd_copy_out(pc, offset, m->m_data, temp);
More information about the svn-src-stable
mailing list