Re: [PATCH 2/3] x86: set_personality_ia32() abuses TS_COMPAT

From: Linus Torvalds
Date: Tue Feb 16 2010 - 13:44:17 EST




On Tue, 16 Feb 2010, Oleg Nesterov wrote:
>
> and, following this logic, shouldn't set_personality_64bit() clear
> TS_COMPAT ?

Yes, I think it should. If we come from a 32-bit environment, and execute
a 64-bit binary, I think the execve() environment of the new 64-bit binary
should be _exactly_ the same as if it was executed from a 64-bit one.

Of course, it's entirely possible that TS_COMPAT simply doesn't matter at
all in either context, but I do think that we should strive for "the
binary does exactly the same regardless of whether it was started from
a 32-bit or a 64-bit binary".

And the best way to guarantee that is to make sure that we really do set
the environment to the same thing. So yes, set_personality_64bit() should
clear all the 32-bit compat bits.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/