Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Martin Michlmayr <tbm@cyrius.com>
To: linux-mips@linux-mips.org
Cc: Roger Leigh <rleigh@debian.org>, 380531-silent@bugs.debian.org
Subject: Re: Bug#380531: linux-2.6: mips and mipsel personality(2) support is broken
Date: Mon, 31 Jul 2006 00:41:37 +0200	[thread overview]
Message-ID: <20060730224137.GP17134@deprecation.cyrius.com> (raw)
In-Reply-To: <20060730183939.7119.48747.reportbug@hardknott.home.whinlatter.ukfsn.org>

[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]

FYI, but report tht "mips and mipsel personality(2) support is broken"

* Roger Leigh <rleigh@debian.org> [2006-07-30 19:39]:
> personality(2) only works the first time it is called [in the lifetime
> of a process/program].  All subsequent calls return EPERM, which is
> not a documented return value; I can see no mention of it in
> kernel/execdomain.c.  None of the other architectures I have tested
> (amd64, arm, i386, ia64, powerpc) behave this way: personality(2) is
> not a privileged call.
> 
> This happens no matter what the value of persona is, even if it is
> just 0xffffffff to query the current personality.
> 
> The attached testcase demonstrates the breakage.  On a working
> platform (powerpc), the output is like this:
> 
> ------------------------
> $ ./testpersona
> Getting personality
> Get returned '0'
> Setting personality '8'
> Set OK
> Getting personality
> Get returned '8'
> Setting personality '0'
> Set OK
> Getting personality
> Get returned '0'
> ------------------------
> 
> 0 == PER_LINUX
> 8 == PER_LINUX32
> 
> It successfully switched from PER_LINUX to PER_LINUX32 and back again,
> checking the personality before and after each change.
> 
> 
> Regards,
> Roger

-- 
Martin Michlmayr
http://www.cyrius.com/

[-- Attachment #2: testpersona.c --]
[-- Type: text/x-csrc, Size: 739 bytes --]

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/personality.h>

int
set_persona (unsigned long p)
{
  fprintf (stderr, "Setting personality '%lu'\n", p);

  int status = personality(p);
  if (status == -1)
    fprintf(stderr, "Set failed: %s\n", strerror(errno));

  fprintf(stderr, "Set OK\n");

  return status;
}

int
get_persona (void)
{
  fprintf (stderr, "Getting personality\n");

  int status = personality(0xffffffff);
  if (status == -1)
    fprintf(stderr, "Get failed: %s\n", strerror(errno));

  fprintf(stderr, "Get returned '%d'\n", status);

  return status;
}

int
main (void)
{
  get_persona();
  set_persona(PER_LINUX32);
  get_persona();
  set_persona(PER_LINUX);
  get_persona();
  return 0;
}

       reply	other threads:[~2006-07-30 22:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060730183939.7119.48747.reportbug@hardknott.home.whinlatter.ukfsn.org>
2006-07-30 22:41 ` Martin Michlmayr [this message]
2006-07-30 23:19   ` Bug#380531: linux-2.6: mips and mipsel personality(2) support is broken Thiemo Seufer
2006-07-30 23:20   ` Roger Leigh

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=20060730224137.GP17134@deprecation.cyrius.com \
    --to=tbm@cyrius.com \
    --cc=380531-silent@bugs.debian.org \
    --cc=linux-mips@linux-mips.org \
    --cc=rleigh@debian.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