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]
Message-ID: <87a96tc692.fsf@nemi.mork.no>
Date:	Mon, 25 Aug 2014 10:39:53 +0200
From:	Bjørn Mork <bjorn@...k.no>
To:	Oliver Neukum <oneukum@...e.de>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH] cdc-ether: clean packet filter upon probe

Oliver Neukum <oneukum@...e.de> writes:
> On Fri, 2014-08-15 at 09:13 +0200, Bjørn Mork wrote:
>> Oliver Neukum <oneukum@...e.de> writes:
>> 
>> > On Thu, 2014-08-14 at 13:11 +0200, Bjørn Mork wrote:
>
>> > Support for this request is mandatory.
>> 
>> Yes, there is no problem for standard conforming ECM devices.  I fully
>> agree there. 
>> 
>> But standard conformance is unfortunately not something we can expect.
>> My question was regarding the non-conforming devices, like the ones
>> supported by th zaurus and rndis_host drivers.  These drivers are made
>
> You have a point. Yet another flag? Do you see an alternative?

Note that I don't know whether this is a real problem or not. I don't
believe I have any zaurus or rndis_host devices.

But how about just splitting the .bind functions for true ECM devices
and the others, letting the zaurus and rndis_host driver continue to use
usbnet_cdc_bind with no filter setting?  Maybe define a new unexported
.bind in cdc_ether for this purpose, moving the ECM specific
initialization there?

Maybe something along this (instead of the change to
usbnet_generic_cdc_bind)?:

static int usbnet_cdc_ecm_bind(struct usbnet *dev, struct usb_interface *intf)
{
        int rv = usbnet_cdc_bind(dev, intf);

	if (rv < 0)
		return rv;

	/* Some devices don't initialise properly. In particular
	 * the packet filter is not reset. There are devices that
	 * don't do reset all the way. So the packet filter should
	 * be set to a sane initial value.
	 */
	rv = usb_control_msg(dev->udev,
			     usb_sndctrlpipe(dev->udev, 0),
			     USB_CDC_SET_ETHERNET_PACKET_FILTER,
			     USB_TYPE_CLASS | USB_RECIP_INTERFACE,
			     USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | USB_CDC_PACKET_TYPE_BROADCAST,
			     intf->cur_altsetting->desc.bInterfaceNumber,
			     NULL,
			     0,
			     USB_CTRL_SET_TIMEOUT);
  	if (rv < 0)
		return rv;
        return 0;
}

..

static const struct driver_info	cdc_info = {
	.description =	"CDC Ethernet Device",
	.flags =	FLAG_ETHER | FLAG_POINTTOPOINT,
	.bind =		usbnet_cdc_ecm_bind,
	.unbind =	usbnet_cdc_unbind,
	.status =	usbnet_cdc_status,
	.manage_power =	usbnet_manage_power,
};


Bjørn
--
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