[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <24f03227-1b55-4e50-b6e9-7ac74fda2602@app.fastmail.com>
Date: Thu, 09 Jan 2025 09:01:16 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "John Paul Adrian Glaubitz" <glaubitz@...sik.fu-berlin.de>,
"Richard Henderson" <richard.henderson@...aro.org>,
"Matt Turner" <mattst88@...il.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>, "Kees Cook" <kees@...nel.org>,
"Paul E. McKenney" <paulmck@...nel.org>, linux-alpha@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Cc: "Michael Cree" <mcree@...on.net.nz>, "Sam James" <sam@...too.org>,
"Maciej W. Rozycki" <macro@...am.me.uk>,
"Geert Uytterhoeven" <geert@...ux-m68k.org>,
"Michael Karcher" <kernel@...rcher.dialup.fu-berlin.de>,
"Chris Hofstaedtler" <zeha@...ian.org>, util-linux@...r.kernel.org
Subject: Re: [PATCH] alpha: Fix personality flag propagation across an exec
On Fri, Jan 3, 2025, at 15:01, John Paul Adrian Glaubitz wrote:
>
> #define SET_PERSONALITY(EX) \
> - set_personality(((EX).e_flags & EF_ALPHA_32BIT) \
> - ? PER_LINUX_32BIT : PER_LINUX)
> + set_personality((((EX).e_flags & EF_ALPHA_32BIT) \
> + ? PER_LINUX_32BIT : PER_LINUX) | (current->personality & (~PER_MASK)))
This looks wrong to me: since ADDR_LIMIT_32BIT is not part of
PER_MASK, executing a regular binary from a taso binary no longer
reverts back to the entire 64-bit address space.
It seems that the behavior on most other architectures changed in 2012
commit 16f3e95b3209 ("cross-arch: don't corrupt personality flags upon
exec()").
At the time, the same bug existed on mips, parisc and tile, but those
got fixed quickly.
There are two related bits I don't quite understand:
- Do we still care about EF_ALPHA_32BIT? I see that it gets set by
"alpha-linux-ld.bfd --taso", but could not find any documentation
on what that flag is actually good for. On all other architectures,
the address space limit gets enforced through a per-thread setting
like TIF_32BIT, not through the personality that gets inherited
by the child processes.
- all architectures other than x86 mask out the lower byte. Why
not that one?
Arnd
Powered by blists - more mailing lists