Re: USBFS Memory allocation Bug

From: Alan Stern
Date: Wed Mar 10 2010 - 10:04:33 EST


On Wed, 10 Mar 2010, Markus Rechberger wrote:

> > At any rate, clearly the bug, if there is one, lies in the memory
> > management subsystem and not in usbfs.
> >
>
> seems like yes, but the final result of this is that mediasrv was not
> killable anymore.

You should have said so earlier. That is indeed a serious bug.

> Shouldn't the syscall just fail if this happens?

It _does_ just fail if memory can't be allocated. Here's the relevant
code from proc_do_submiturb():

as->urb->transfer_buffer = kmalloc(uurb->buffer_length,
GFP_KERNEL);
if (!as->urb->transfer_buffer) {
kfree(isopkt);
kfree(dr);
free_async(as);
return -ENOMEM;
}

Where was the mediasrv process hung when you tried to kill it?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/