Re: [PATCH] lib: introduce strdup_from_user

From: Timur Tabi
Date: Fri Jun 03 2011 - 14:54:50 EST


Alexey Dobriyan wrote:
> It leaks first allocation if second one fails.
>
> Come on.

Ugh, sorry. In my defense, I am suffering from allergies at the moment.

> Show you user in driver, maybe what we're discussing is moot.

The driver and discussion on it can be found here:

http://patchwork.ozlabs.org/patch/98233/

Search for "ioctl_dtprop" to see its usage.

In summary, I'm copying a user-space string into a kmalloc'd buffer so that it's
physically contiguous and I can get the physical address for it. I then call
our hypervisor and give it the physical address. This is why I want a copy of
the string in a buffer allocated via kmalloc.

--
Timur Tabi
Linux kernel developer at Freescale

--
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/