lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 21 Jan 2013 18:59:05 +0100
From:	Alexey ORISHKO <alexey.orishko@...ricsson.com>
To:	Oliver Neukum <oneukum@...e.de>,
	Bjørn Mork <bjorn@...k.no>
Cc:	Alexey Orishko <alexey.orishko@...il.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	Greg Suarez <gsuarez@...thmicro.com>
Subject: RE: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

> -----Original Message-----
> From: Oliver Neukum [mailto:oneukum@...e.de]
> On Monday 21 January 2013 15:47:13 Bjørn Mork wrote:
> > But I wonder if this isn't really a generic problem in usbnet.  The
> > FLAG_MULTI_PACKET test here seems completely bogus:
> >
> >         if (length % dev->maxpacket == 0) {
> >                 if (!(info->flags & FLAG_SEND_ZLP)) {
> >                         if (!(info->flags & FLAG_MULTI_PACKET)) {
> >                                 urb->transfer_buffer_length++;
> >                                 if (skb_tailroom(skb)) {
> >                                         skb->data[skb->len] = 0;
> >                                         __skb_put(skb, 1);
> >                                 }
> >                         }
> >                 } else
> >                         urb->transfer_flags |= URB_ZERO_PACKET;
> >         }
> >
> > Either the FLAG_MULTI_PACKET minidriver will have already padded the
> > buffer so that we do not hit (length % dev->maxpacket == 0), or we
> > should choose one of the alternatives: ZLP or padding.
> 
> But we cannot simply call __skb_put for a complicated data frame.
> Besides you may want the current behavior.
> 

Specification says: 
NCM/MBIM shall not send ZLP if buffer size is dwNtbOutMaxSize.

The problem is: 
dwNtbOutMaxSize value is negotiated between host and device NCM/MBIM
entities and usbnet has no knowledge about it.

Adding one byte to make buffer looking like a short packet was most
simple approach instead of inventing a way to communicate 
dwNtbOutMaxSize to usbnet.

You could drop short packet approach if dwNtbOutMaxSize is provided
to usbnet and decision is made accordingly to NCM/MBIM spec (with
exception to faulty devices).

Regards,
Alexey
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ