Re: [PATCH 3/6] arch: x86: Wrap TIF_X32 checks

From: Andy Lutomirski
Date: Wed Jul 29 2020 - 00:54:28 EST


On Tue, Jul 28, 2020 at 1:22 PM Gabriel Krisman Bertazi
<krisman@xxxxxxxxxxxxx> wrote:
>
> In preparation to remove TIF_X32, add a wrapper that checks the process
> is using the X32 ABI without using the flag directly.

I'm not sure what the right solution here is, but all three of these
functions are in the ELF loading path, and the callers of all three
have access to the full ELF info. Let's instead either stick enough
information into bprm to figure out what ABI is being loaded or pass
in a pointer to the ELF headers. The latter might be a bit nasty due
to the way that the ELF headers have a different type for compat.

In any case, sticking this into per-task state (task_struct or
anything in it) is silly. The full ABI info is on the call stack, and
there's no need to keep this particular bit around forever.

--Andy