Skip to contentSkip to conversation

Is this bug too obvious?

DISCUSSION Chuck Ebbert 5 participants 7 messages Feb 14, 2007 – Feb 16, 2007

lore
Share & tools
lore
#0 lore raw

drivers/usb/net/usbnet.c:

int
usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)

{
        struct usbnet                   *dev;
        struct net_device               *net;
        struct usb_host_interface       *interface;
        struct driver_info              *info;
        struct usb_device               *xdev;
        int                             status;

	...

        net = alloc_etherdev(sizeof(*dev));
                                    ^^^^
	                            *net ???
#1 lore raw

On Tue, 13 Feb 2007 19:41:34 -0500 Chuck Ebbert wrote:

[adding linux-usb-devel]

Quoted 18 lines

drivers/usb/net/usbnet.c:

int
usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)

{
        struct usbnet                   *dev;
        struct net_device               *net;
        struct usb_host_interface       *interface;
        struct driver_info              *info;
        struct usb_device               *xdev;
        int                             status;

	...

        net = alloc_etherdev(sizeof(*dev));
                                    ^^^^
	                            *net ???
Quoted 1 line

-

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#2 lore raw

No bug; read net/ethernet/eth.c to see what that parameter means.

Quoted 12 lines
Quoted 12 lines

drivers/usb/net/usbnet.c:

int
usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)

{
        struct usbnet                   *dev;
        struct net_device               *net;
        struct usb_host_interface       *interface;
        struct driver_info              *info;
        struct usb_device               *xdev;
        int                             status;
Quoted 5 lines
Quoted 5 lines
	...

        net = alloc_etherdev(sizeof(*dev));
                                    ^^^^
	                            *net ???

It's allocating *extra* space ... used just a few lines later:

        dev = netdev_priv(net);
#3 lore raw
In reply to Chuck Ebbert
Quoted 4 lines · Chuck Ebbert

drivers/usb/net/usbnet.c:

int
usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)

Quoted 13 lines
{
        struct usbnet                   *dev;
        struct net_device               *net;
        struct usb_host_interface       *interface;
        struct driver_info              *info;
        struct usb_device               *xdev;
        int                             status;

	...

        net = alloc_etherdev(sizeof(*dev));
                                    ^^^^
	                            *net ???

No, alloc_etherdev takes the size of the private data, which, in this case, is *dev.

-Daniel
*This .sig left intentionally blank*

#4 lore raw
Quoted 20 lines · Daniel Barkalow
Quoted 4 lines · Chuck Ebbert

drivers/usb/net/usbnet.c:

int
usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)

Quoted 13 lines
{
        struct usbnet                   *dev;
        struct net_device               *net;
        struct usb_host_interface       *interface;
        struct driver_info              *info;
        struct usb_device               *xdev;
        int                             status;

	...

        net = alloc_etherdev(sizeof(*dev));
                                    ^^^^
	                            *net ???
Quoted 5 lines

No, alloc_etherdev takes the size of the private data, which, in this case, is *dev.

-Daniel
*This .sig left intentionally blank*

OK I'll keep looking for the cause of the oops then:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=228231

#5 lore raw

usbnet/rndis (was: Is this bug too obvious?)

Quoted 4 lines · Chuck Ebbert

OK I'll keep looking for the cause of the oops then:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=228231

Quoted 13 lines
Feb 12 01:11:29 MyComputer kernel: ohci_hcd 0000:00:02.1: auto-wakeup
Feb 12 01:11:30 MyComputer kernel: usb 2-3: new full speed USB device using ohci_hcd and address 2
Feb 12 01:11:30 MyComputer kernel: usb 2-3: configuration #1 chosen from 1 choice
Feb 12 01:11:30 MyComputer kernel: drivers/usb/class/cdc-acm.c: Ignoring extra header, type -3, length 4
Feb 12 01:11:30 MyComputer kernel: cdc_acm 2-3:1.1: ttyACM0: USB ACM device
Feb 12 01:11:30 MyComputer kernel: usbcore: registered new interface driver cdc_acm
Feb 12 01:11:30 MyComputer kernel: drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters
Feb 12 01:11:31 MyComputer kernel: usbcore: registered new interface driver cdc_ether
Feb 12 01:11:31 MyComputer kernel: rndis_host 2-3:1.9: RNDIS init failed, -110
Feb 12 01:11:31 MyComputer kernel: usb%d: unregister 'rndis_host' usb-0000:00:02.1-3, RNDIS device
Feb 12 01:11:31 MyComputer kernel: BUGging on (!PageSlab(page))
Feb 12 01:11:31 MyComputer kernel: ------------[ cut here ]------------
Feb 12 01:11:31 MyComputer kernel: kernel BUG at mm/slab.c:594!

This looks like a kfree with a bogus address, possibly poisoned.

If you don't do it sooner, I'll look at the error paths in rndis and/or usbnet.

BTW, for USB code, it's best to send to [email protected].

-- Pete

#6 lore raw

Re: [linux-usb-devel] usbnet/rndis (was: Is this bug too obvious?)

Quoted 3 lines

If you don't do it sooner, I'll look at the error paths in rndis and/or usbnet.

Try that patch I sent by this morning. ISTR getting some positive reports from that...