Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: David Daney <ddaney@caviumnetworks.com>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org,
	Camm Maguire <camm@maguirefamily.org>
Subject: Re: [PATCH 2/2] MIPS: Don't clobber personality bits in 32-bit sys_personality().
Date: Tue, 02 Nov 2010 19:11:03 +0300	[thread overview]
Message-ID: <4CD03817.4050907@mvista.com> (raw)
In-Reply-To: <1288658588-26801-2-git-send-email-ddaney@caviumnetworks.com>

Hello.

David Daney wrote:

> If PER_LINUX32 has been set on a 32-bit kernel, only twiddle with the
> low-order personality bits, let the upper bits pass through.

> Signed-off-by: David Daney <ddaney@caviumnetworks.com>
> Cc: Camm Maguire <camm@maguirefamily.org>
> ---
>  arch/mips/kernel/linux32.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)

> diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
> index 6343b4a..a63f4e2 100644
> --- a/arch/mips/kernel/linux32.c
> +++ b/arch/mips/kernel/linux32.c
> @@ -252,13 +252,13 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
>  SYSCALL_DEFINE1(32_personality, unsigned long, personality)
>  {
>  	int ret;
> -	personality &= 0xffffffff;
> +	unsigned int p = personality & 0xffffffff;

    I'd have inserted an empty line here...

>  	if (personality(current->personality) == PER_LINUX32 &&
> -	    personality == PER_LINUX)
> -		personality = PER_LINUX32;
> -	ret = sys_personality(personality);
> -	if (ret == PER_LINUX32)
> -		ret = PER_LINUX;
> +	    personality(p) == PER_LINUX)
> +		p = (p & ~PER_MASK) | PER_LINUX32;
> +	ret = sys_personality(p);
> +	if (ret != -1 && personality(ret) == PER_LINUX32)
> +		ret = (ret & ~PER_MASK) | PER_LINUX;
>  	return ret;
>  }

WBR, Sergei

  reply	other threads:[~2010-11-02 16:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02  0:43 [PATCH 1/2] MIPS: Quit clobbering personality bits David Daney
2010-11-02  0:43 ` [PATCH 2/2] MIPS: Don't clobber personality bits in 32-bit sys_personality() David Daney
2010-11-02 16:11   ` Sergei Shtylyov [this message]
2010-11-05 15:17   ` Ralf Baechle
2010-11-02 18:43 ` [PATCH 1/2] MIPS: Quit clobbering personality bits Camm Maguire
2010-11-05 11:12 ` Ralf Baechle

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=4CD03817.4050907@mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=camm@maguirefamily.org \
    --cc=ddaney@caviumnetworks.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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