Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758866AbYFZRqc (ORCPT ); Thu, 26 Jun 2008 13:46:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758247AbYFZRpw (ORCPT ); Thu, 26 Jun 2008 13:45:52 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:60444 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758258AbYFZRpv (ORCPT ); Thu, 26 Jun 2008 13:45:51 -0400 Date: Thu, 26 Jun 2008 09:30:12 -0700 (PDT) From: Linus Torvalds To: Vitaly Mayatskikh cc: Anton Arapov , Andi Kleen , linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: [PATCH] Fix copy_user on x86_64 In-Reply-To: Message-ID: References: <48635DA0.80102@redhat.com> User-Agent: Alpine 1.10 (LFD 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1283 Lines: 29 On Thu, 26 Jun 2008, Vitaly Mayatskikh wrote: > > Seems reasonable. However, we still need specialized memset() routine, > because, again, destination can fail. Thanks for the review, Linus! Actually, the "zero at the end" case is only for copy_from_user() (at least it _should_ be), so for the clearing-at-end you should be able to use a regular memset(). But it's not a big deal either way. As long as we only get into the fixup routine at exception time, and handle all the common cases fast (ie do the 32-byte unrolled thing etc optimally), the fixup routine can do everything a byte at a time with "get_user()" and "put_user()" etc. The "fault at copy_*_user()" case really isn't all that performance-sensitive, because it really happens essentially _never_. (That's obviously why nobody even noticed how broken they were for essentially what must have been _years_. It's not just not a performance sensitive area, it's one that is entered so seldom that it's hard to ever hit any correctness issues either) Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/