Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752263Ab1BZNG1 (ORCPT ); Sat, 26 Feb 2011 08:06:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7497 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750804Ab1BZNG0 (ORCPT ); Sat, 26 Feb 2011 08:06:26 -0500 Date: Sat, 26 Feb 2011 13:57:31 +0100 From: Oleg Nesterov To: Linus Torvalds Cc: Andrew Morton , KOSAKI Motohiro , LKML , linux-mm , pageexec@freemail.hu, Solar Designer , Eugene Teo , Brad Spengler , Roland McGrath , Milton Miller Subject: Re: [PATCH 3/5] exec: unify compat_do_execve() code Message-ID: <20110226125731.GA5315@redhat.com> References: <20101130200129.GG11905@redhat.com> <20101201182747.GB6143@redhat.com> <20110225175202.GA19059@redhat.com> <20110225175314.GD19059@redhat.com> <20110226123731.GC4416@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110226123731.GC4416@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1063 Lines: 47 On 02/26, Oleg Nesterov wrote: > > Once again, to me "void __user*" looks better (just simpler). In this > case get_arg_ptr() becomes (without const/__user for the clarity) > > void *get_arg_ptr(void **argv, int argc, bool compat) > { > char *ptr; > > #ifdef CONFIG_COMPAT > if (unlikely(compat)) { > compat_uptr_t *a = argv; > compat_uptr_t p; > > if (get_user(p, a + argc)) > return ERR_PTR(-EFAULT); > > return compat_ptr(p); > } > #endif > > if (get_user(ptr, argv + argc)) > return ERR_PTR(-EFAULT); > > return ptr; > } > > Otherwise, get_arg_ptr() should return conditional_user_ptr_t as well, No, this is not true, I am stupid. Still, > this looks like the unnecessary complication to me, but of course this > is subjective. > > So, what do you think? Yes, please. Oleg. -- 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/