aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/apm/xgene
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2015-11-23 14:32:10 +0100
committerDavid S. Miller <davem@davemloft.net>2015-11-24 14:26:16 -0500
commit6527f833bf3fa34ed53e10b8010760fff42169f0 (patch)
tree2d79b1ecab3e525c5d6e9f80480d1f121ca8334e /drivers/net/ethernet/apm/xgene
parentMerge tag 'linux-can-fixes-for-4.4-20151123' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can (diff)
downloadlinux-dev-6527f833bf3fa34ed53e10b8010760fff42169f0.tar.xz
linux-dev-6527f833bf3fa34ed53e10b8010760fff42169f0.zip
net: cdc_ncm: fix NULL pointer deref in cdc_ncm_bind_common
Commit 77b0a099674a ("cdc-ncm: use common parser") added a dangerous new trust in the CDC functional descriptors presented by the device, unconditionally assuming that any device handled by the driver has a CDC Union descriptor. This descriptor is required by the NCM and MBIM specs, but crashing on non-compliant devices is still unacceptable. Not only will that allow malicious devices to crash the kernel, but in this case it is also well known that there are non-compliant real devices on the market - as shown by the comment accompanying the IAD workaround in the same function. The Sierra Wireless EM7305 is an example of such device, having a CDC header and a CDC MBIM descriptor but no CDC Union: Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 12 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 2 Communications bInterfaceSubClass 14 bInterfaceProtocol 0 iInterface 0 CDC Header: bcdCDC 1.10 CDC MBIM: bcdMBIMVersion 1.00 wMaxControlMessage 4096 bNumberFilters 16 bMaxFilterSize 128 wMaxSegmentSize 4064 bmNetworkCapabilities 0x20 8-byte ntb input size Endpoint Descriptor: .. The conversion to a common parser also left the local cdc_union variable untouched. This caused the IAD workaround code to be applied to all devices with an IAD descriptor, which was never intended. Finish the conversion by testing for hdr.usb_cdc_union_desc instead. Cc: Oliver Neukum <oneukum@suse.com> Fixes: 77b0a099674a ("cdc-ncm: use common parser") Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/apm/xgene')
0 files changed, 0 insertions, 0 deletions