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: <3a3680030905040813x3e372f64kf73e33cdab45a31b@mail.gmail.com>
Date:	Mon, 4 May 2009 23:13:49 +0800
From:	Li Hong <lihong.hi@...il.com>
To:	Greg KH <greg@...ah.com>
Cc:	Pekka Enberg <penberg@...helsinki.fi>,
	David Brownell <david-b@...bell.net>,
	Oliver Neukum <oliver@...kum.org>, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: use memdup_user()

2009/5/4 Greg KH <greg@...ah.com>:
> On Mon, May 04, 2009 at 10:41:51AM +0300, Pekka Enberg wrote:
>> Hi!
>>
>> On Sunday 03 May 2009, Oliver Neukum wrote:
>> >> No. To make it plain. To me any use of memdup_user() in USB code
>> >> is a bad idea. I don't want to have to think about a new primitive.
>>
>> On Mon, May 4, 2009 at 10:02 AM, David Brownell <david-b@...bell.net> wrote:
>> > Unless it's incorrect to use that, I have to say that it
>> > makes more sense to use that utility than recreate it by
>> > open-coding...
>>
>> Yup, and I don't really see how anyone can avoid "thinking about a new
>> primitive" anyway. We have it in the kernel now and surely it will
>> appear under drivers/usb/ sooner or later...
>
> Well, how about passing the GPF flags down to memdup_user() so that we
> can use it in the usb subsystem, and Oliver's complaint will be resolve?
>
> thanks,
>
> greg k-h
>

No, the debate is not here. As the comment in memdup_user() says:

        /*
         * Always use GFP_KERNEL, since copy_from_user() can sleep and
         * cause pagefault, which makes it pointless to use GFP_NOFS
         * or GFP_ATOMIC.
         */

So it is pointless to add a GFP flag to memdup_user().

I guess what Oliver insists is that the involvement of memdup_user() erases
the explicit call of kmalloc(). However, doesn't every function wrap
some details?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ