lkml.org 
[lkml]   [2007]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Q: a bogus set_fs(USER_DS) in setup_frame/setup_rt_frame ?


On Tue, 17 Jul 2007, Oleg Nesterov wrote:
>
> I am really puzzled by set_fs(USER_DS) in setup_frame/setup_rt_frame.
>
> How is it possible that current->addr_limit != USER_DS ? If this _is_
> possible, how can can we trust the result of access_ok() above?

Heh. I think it's entirely historical.

Please realize that the whole reason that function is called "set_fs()" is
that it literally used to set the %fs segment register, not
"->addr_limit".

So I think the "set_fs(USER_DS)" is there _only_ to match the other

regs->xds = __USER_DS;
regs->xes = __USER_DS;
regs->xss = __USER_DS;
regs->xcs = __USER_CS;

things, and never mattered. And now it matters even less, and has been
copied to all other architectures where it is just totally insane.

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/

\
 
 \ /
  Last update: 2007-07-17 18:11    [W:0.063 / U:1.204 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site