[PATCH] usb: cdc-ncm: struct usb_cdc_ncm_ndp_input_size not initialized

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

we developing CDC/NCM firmware and found that the Linux CDC/NCM is not compliant to the USB CDC/NCM specification. The cause is a Bug in the cdc_ncm.c file. The structure usb_cdc_ncm_ndp_input_size is only allocated but not initialized. The CDC/NCM specification section "6.2.7 SetNtbInputSize" says that the dwNtbInMaxSize field must be at least 2048. But the current implementation leave it 0, because it is not initialized.

I'm not sure if it is also required to initialize the wNtbInMaxDatagrams field because 0 (no limit) is a valid value.


--- linux-3.6-rc4.orig/drivers/net/usb/cdc_ncm.c 2012-09-06 14:05:26.981402153 +0200 +++ linux-3.6-rc4/drivers/net/usb/cdc_ncm.c 2012-09-06 14:11:57.137398615 +0200
@@ -224,6 +224,7 @@
 				err = -ENOMEM;
 				goto size_err;
 			}
+			ndp_in_sz->dwNtbInMaxSize = cpu_to_le32(ctx->rx_max);

 			err = usb_control_msg(ctx->udev,
 					usb_sndctrlpipe(ctx->udev, 0),




--
Kind regards,
Frank Hoffmann

Thesycon GmbH
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux