linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Andreas Schwab <schwab@linux-m68k.org>,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] powerpc: fix personality handling in ppc64_personality()
Date: Wed, 05 Sep 2012 12:54:03 +1000	[thread overview]
Message-ID: <1346813643.2257.24.camel@pasglop> (raw)
In-Reply-To: <alpine.LNX.2.00.1208020907490.14910@pobox.suse.cz>

On Thu, 2012-08-02 at 09:10 +0200, Jiri Kosina wrote:
> Directly comparing current->personality against PER_LINUX32 doesn't work
> in cases when any of the personality flags stored in the top three bytes
> are used.
> 
> Directly forcefully setting personality to PER_LINUX32 or PER_LINUX
> discards any flags stored in the top three bytes
> 
> Use personality() macro to compare only PER_MASK bytes and make sure that
> we are setting only the bits that should be set, instead of
> overwriting the whole value.
> 
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
> ---
> 
> changed since v1: fix the bit ops to reflect the fact that PER_LINUX is 
> actually 0

Had already merged v1 (oops.. didn't spot the issue with PER_LINUX being
0). Can you send an incremental fixup ?

Cheers,
Ben.

>  arch/powerpc/kernel/syscalls.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
> index f2496f2..dc1558e 100644
> --- a/arch/powerpc/kernel/syscalls.c
> +++ b/arch/powerpc/kernel/syscalls.c
> @@ -107,11 +107,11 @@ long ppc64_personality(unsigned long personality)
>  	long ret;
>  
>  	if (personality(current->personality) == PER_LINUX32
> -	    && personality == PER_LINUX)
> -		personality = PER_LINUX32;
> +	    && personality(personality) == PER_LINUX)
> +		personality |= PER_LINUX32;
>  	ret = sys_personality(personality);
> -	if (ret == PER_LINUX32)
> -		ret = PER_LINUX;
> +	if (personality(ret) == PER_LINUX32)
> +		ret &= ~PER_LINUX32;
>  	return ret;
>  }
>  #endif
> -- 
> 1.7.3.1
> 



  reply	other threads:[~2012-09-05  2:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-01 20:03 [PATCH] powerpc: fix personality handling in ppc64_personality() Jiri Kosina
2012-08-01 22:19 ` Andreas Schwab
2012-08-02  7:10   ` [PATCH v2] " Jiri Kosina
2012-09-05  2:54     ` Benjamin Herrenschmidt [this message]
2012-09-05  8:56       ` Jiri Kosina
2012-09-05 21:13         ` Benjamin Herrenschmidt
2012-09-06  8:46           ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346813643.2257.24.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).