From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 20 May 2002 06:59:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 20 May 2002 06:59:24 -0400 Received: from ns.suse.de ([213.95.15.193]:17927 "HELO Cantor.suse.de") by vger.kernel.org with SMTP id ; Mon, 20 May 2002 06:59:24 -0400 To: Rusty Russell Cc: linux-kernel@vger.kernel.org Subject: Re: AUDIT: copy_from_user is a deathtrap. In-Reply-To: From: Andi Kleen Date: 20 May 2002 12:59:23 +0200 Message-ID: X-Mailer: Gnus v5.7/Emacs 20.6 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Rusty Russell writes: > In message you wr > ite: > > ret = copy_from_user(xxx); > > if (ret) > > return ret; > > > > which is apparently your suggestion. > > Not quite: > copy_from_user(xxx); > > Is my suggestion. No error return. I don't think it is a good idea. Consider a driver that does lots of small copy_from_user() from user space for a longer write (e.g. TCP to a small MSS) If xxx was faulting it would eat a lot of cycles with faulting again and again. -Andi