lkml.org 
[lkml]   [2012]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 16/31] arm64: ELF definitions
On Wed, Aug 15, 2012 at 03:15:39PM +0100, Arnd Bergmann wrote:
> On Tuesday 14 August 2012, Catalin Marinas wrote:
> > +
> > +void elf_set_personality(int personality)
> > +{
> > + switch (personality & PER_MASK) {
> > + case PER_LINUX:
> > + clear_thread_flag(TIF_32BIT);
> > + break;
> > + case PER_LINUX32:
> > + set_thread_flag(TIF_32BIT);
> > + break;
> > + default:
> > + pr_warning("Process %s tried to assume unknown personality %d\n",
> > + current->comm, personality);
> > + return;
> > + }
> > +
> > + current->personality = personality;
> > +}
> > +EXPORT_SYMBOL(elf_set_personality);
>
> This looks wrong: PER_LINUX/PER_LINUX32 decides over the output of the
> uname system call, while TIF_32BIT decides over the instruction set
> when returning to user space. You definitely should not set the personality
> to the value you pass from the elf loader. Instead, just do
>
> #define SET_PERSONALITY(ex) clear_thread_flag(TIF_32BIT);
> #defined COMPAT_SET_PERSONALITY(ex) set_thread_flag(TIF_32BIT);

In this case, won't uname be incorrect (aarch64l) for aarch32 tasks (which
expect something like armv8l)?

Will


\
 
 \ /
  Last update: 2012-08-16 13:01    [W:0.187 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site