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
