Re: [PATCH 4/6] improve sys_personality for compat architectures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 01 February 2010, Christoph Hellwig wrote:
> +/*
> + * Get/set the personality.
> + *
> + * Note that we simply return PER_LINUX even if we actually have a 32-bit
> + * task (PER_LINUX32) as this is expected by 32-bit userland.
> + */
>  SYSCALL_DEFINE1(personality, u_long, personality)
>  {
>         u_long old = current->personality;
>  
>         if (personality != 0xffffffff) {
> +               if (personality(old) == PER_LINUX32 &&
> +                   personality == PER_LINUX)
> +                       personality = PER_LINUX32;
>                 set_personality(personality);
>                 if (current->personality != personality)
>                         return -EINVAL;
>         }
>  
> -       return (long)old;
> +       return (long)(old == PER_LINUX32 ? PER_LINUX : old);
>  }

What does this do for a native 64 bit process setting PER_LINUX32?
It looks to me like it could never set it back to the original
value, or am I missing something here?

It's what the arch specific code does already, but it seems a bit
strange anyway.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux