From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753396AbZECRJX (ORCPT ); Sun, 3 May 2009 13:09:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752291AbZECRJM (ORCPT ); Sun, 3 May 2009 13:09:12 -0400 Received: from smtp-out003.kontent.com ([81.88.40.217]:49405 "EHLO smtp-out003.kontent.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255AbZECRJL (ORCPT ); Sun, 3 May 2009 13:09:11 -0400 From: Oliver Neukum To: Li Hong Subject: Re: [PATCH] usb: use memdup_user() Date: Sun, 3 May 2009 19:09:13 +0200 User-Agent: KMail/1.10.3 (Linux/2.6.27.21-0.1-default; KDE/4.1.3; x86_64; ; ) Cc: oliver@neukum.name, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <3a3680030905030900x672af596mc2ebc3c38f119c92@mail.gmail.com> In-Reply-To: <3a3680030905030900x672af596mc2ebc3c38f119c92@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905031909.14101.oliver@neukum.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Sonntag, 3. Mai 2009 18:00:56 schrieb Li Hong: > Replace a combination call of kmalloc() and copy_from_user() with > memdup_user(). To be precise. copy_*_user() of course implies that you can do GFP_KERNEL. But the point is one of design. Right now I can change locking and if that means that one must use GFP_NOIO, which is common in usb due to the storage driver, we can find out by simply grepping and move the user space copy outside of the loop. If you make that change we must grep against a second and rare key. Regards Oliver