cdc_acm - fragmented notifications

2016-11-10 Thread Tobias Herzog
Hi, I'm trying to build an usb device conforming to the CDC ACM device class. The device uses an interrupt IN endpoint with a max packet size of 8 bytes. I tried to send a SERIAL_STATE notification to the host (to report parity errors, etc.) and noticed, that it is not handled as I would expect:

Re: cdc_acm - fragmented notifications

2016-11-17 Thread Tobias Herzog
> If they mention it, it may be more widely used. > I'd welcome a patch for the ACM driver. > Would you provide one? Thank you for your reply. I think I'll give it a try. /Tobias -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to

Re: [PATCH v2 1/4] cdc-acm: reassemble fragmented notifications

2017-03-24 Thread Tobias Herzog
Hi Oliver, thank you for your patience... :) I have a question to one of your comments (see below). Best regards, Tobias > Am Samstag, den 18.03.2017, 19:52 +0100 schrieb Tobias Herzog: > > > > USB devices may have very limitited endpoint packet sizes, so that > &

[PATCH v3 2/4] cdc-acm: reassemble fragmented notifications

2017-03-30 Thread Tobias Herzog
USB devices may have very limited endpoint packet sizes, so that notifications can not be transferred within one single usb packet. Reassembling of multiple packages may be necessary. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/class/cdc-acm.c

[PATCH v3 3/4] cdc-acm: log message for serial state notification

2017-03-30 Thread Tobias Herzog
Adds a similar log message to USB_CDC_NOTIFY_SERIAL_STATE as it is already done with USB_CDC_NOTIFY_NETWORK_CONNECTION. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/class/cdc-acm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/class/cdc-acm.c b/drive

[PATCH v3 0/4] cdc-acm: reassemble fragmented notifications

2017-03-30 Thread Tobias Herzog
+ code structure (unneeded goto) Tobias Herzog (4): cdc-acm: fix possible invalid access when processing notification cdc-acm: reassemble fragmented notifications cdc-acm: log message for serial state notification cdc-acm: remove unused element of struct acm drivers/usb/class/cdc-acm.c

[PATCH v3 4/4] cdc-acm: remove unused element of struct acm

2017-03-30 Thread Tobias Herzog
write_used was introduced with commit 884b600f63dc ("[PATCH] USB: fix acm trouble with terminals") but never used since. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/class/cdc-acm.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/class/cdc-acm

[PATCH v3 1/4] cdc-acm: fix possible invalid access when processing notification

2017-03-30 Thread Tobias Herzog
Notifications may only be 8 bytes long. Accessing the 9th and 10th byte of unimplemented/unknown notifications may be insecure. Also check the length of known notifications before accessing anything behind the 8th byte. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/cla

[PATCH v2 0/4] cdc-acm: reassemble fragmented notifications

2017-03-18 Thread Tobias Herzog
issues with endianess * check buffer allocation (kmalloc) * don't use hard coded size of notification-header * fixed typo + code structure (unneeded goto) Tobias Herzog (4): cdc-acm: reassemble fragmented notifications cdc-acm: fix possible invalid access when processing notification cdc-acm

[PATCH v2 4/4] cdc-acm: remove unused element of struct acm

2017-03-18 Thread Tobias Herzog
write_used was introduced with commit 884b600f63dc ("[PATCH] USB: fix acm trouble with terminals") but never used since. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/class/cdc-acm.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/class/cdc-acm

[PATCH v2 2/4] cdc-acm: fix possible invalid access when processing notification

2017-03-18 Thread Tobias Herzog
Notifications may only be 8 bytes so long. Accessing the 9th and 10th byte of unimplemented/unknown notifications may be insecure. Also check the length of known notifications before accessing anything behind the 8th byte. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/cla

[PATCH v2 3/4] cdc-acm: log message for serial state notification

2017-03-18 Thread Tobias Herzog
Adds a similar log message to USB_CDC_NOTIFY_SERIAL_STATE as it is already done with USB_CDC_NOTIFY_NETWORK_CONNECTION. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/class/cdc-acm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/class/cdc-acm.c b/drive

Re: [PATCH 1/4] cdc-acm: reassemble fragmented notifications

2017-03-18 Thread Tobias Herzog
Hi, thank you for your feedback. I tried to fix all issues with v2. I was just unsure with one point (see comment). /tobias > Am Dienstag, den 14.03.2017, 21:14 +0100 schrieb Tobias Herzog: > > > > USB devices may have very limitited endpoint packet sizes, so that > &

[PATCH v2 1/4] cdc-acm: reassemble fragmented notifications

2017-03-18 Thread Tobias Herzog
USB devices may have very limitited endpoint packet sizes, so that notifications can not be transferred within one single usb packet. Reassembling of multiple packages may be necessary. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/class/cdc-acm.c

[PATCH 1/4] cdc-acm: reassemble fragmented notifications

2017-03-14 Thread Tobias Herzog
USB devices may have very limitited endpoint packet sizes, so that notifications can not be transferred within one single usb packet. Reassembling of multiple packages may be necessary. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/class/cdc-acm.c

[PATCH 2/4] cdc-acm: fix possible invalid access when processing notification

2017-03-14 Thread Tobias Herzog
Notifications may only be 8 bytes so long. Accessing the 9th and 10th byte of unimplemented/unknown notifications may be insecure. Also check the length of known notifications before accessing anything behind the 8th byte. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/cla

[PATCH 3/4] cdc-acm: log message for serial state notification

2017-03-14 Thread Tobias Herzog
Adds a similar log message to USB_CDC_NOTIFY_SERIAL_STATE as it is already done with USB_CDC_NOTIFY_NETWORK_CONNECTION. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/class/cdc-acm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/class/cdc-acm.c b/drive

[PATCH 4/4] cdc-acm: remove unused element of struct acm

2017-03-14 Thread Tobias Herzog
write_used was introduced with commit 884b600f63dc ("[PATCH] USB: fix acm trouble with terminals") but never used since. Signed-off-by: Tobias Herzog <t-her...@gmx.de> --- drivers/usb/class/cdc-acm.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/class/cdc-acm