From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sat, 5 Feb 2005 09:06:19 +0000 From: Russell King Subject: Re: [patch 19/24] TASK_SIZE is variable. Message-ID: <20050205090619.C30866@flint.arm.linux.org.uk> References: <200502050150.j151osl11380@mail.osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ; from torvalds@osdl.org on Fri, Feb 04, 2005 at 07:29:17PM -0800 Sender: Russell King To: Linus Torvalds Cc: Andrew Morton , dwmw2@infradead.org, Linux Arch list List-ID: On Fri, Feb 04, 2005 at 07:29:17PM -0800, Linus Torvalds wrote: > For example, replacing TASK_SIZE in fs/namei.c with "thread->addr_limit" > would actually clean up the code: it would mean that the games with > "get_fs()" etc would just go away, to be replaced with something like > > unsigned long len; > unsigned long limit = current_thread_info()->addr_limit; > > if ((unsigned long) filename >= limit) > return -EFAULT; > len = limit - (unsigned long) filename; > if (len > PATH_MAX) > len = PATH_MAX; > > which looks cleaner. Except that "addr_limit" may be defined by an architecture to be zero (which can be interpreted as 4GB by the arch specific code) for the case where we allow kernel mode access. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core