mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Christoph Hellwig <hch@infradead.org>
Cc: Paul Mackerras <paulus@au1.ibm.com>,
	Fabrice Bellard <fabrice.bellard@free.fr>,
	linux-kernel@vger.kernel.org,
	Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: Re: [PATCH] Qemu support for PPC
Date: Tue, 08 Apr 2003 11:52:57 +1000	[thread overview]
Message-ID: <20030408021238.F19C42C66E@lists.samba.org> (raw)
In-Reply-To: Your message of "Mon, 07 Apr 2003 13:49:55 +0100." <20030407134954.A31558@infradead.org>

In message <20030407134954.A31558@infradead.org> you write:
> On Mon, Apr 07, 2003 at 06:34:17PM +1000, Rusty Russell wrote:
> > Oh good: a serious question.  Why don't we drop the personality field
> > in struct task_struct and just use exec_domain?  Then the flags could
> > be unfolded from the personality number, and placed in a "flags"
> > element in struct exec_domain, the personality() macro would vanish,
> > the set_personality() macro would vanish, and things would be
> > generally clearer?
> 
> The personality number is exposed through sys_personality, so unfortunately
> we can't get rid of it.  I still wonder what crack the person inviting this
> scheme was smoking, though..

Yes.  It's a PITA that the bottom 8 bits map to exec_domain, and the
rest are random flags.  If each different personality mapped to a
separate exec_domain, the flags could be moved to the exec_domain
struct and it'd be far more logical.  But as you say, this would break
userspace which expects to be able to set the exec_domain and the
flags separately 8(.

BTW, there's a module refcount leak here:

int
__set_personality(u_long personality)
{
	struct exec_domain	*ep, *oep;

	ep = lookup_exec_domain(personality);
	if (ep == current_thread_info()->exec_domain) {
		current->personality = personality;
		return 0;
	}

You need "module_put(ep->owner)", since lookup_exec_domain bumps the
refcount.


> > That applies to any kernel mod, of course.  qemu is much more usable
> > (ie. it's sanely packagable) with this functionality, ie. it's pretty
> > much a requirement for increasing adoption.
> 
> You can just easily let it run in a chroot or separate namespace,
> you just won't get second look semantics. (Personally I think that's
> a benefit, but some people disagree with this).

No, then you can't access your files, which is unacceptable for many
users.

I've done the userspace implementation: I'll see if Fabrice chokes on
the speed hit.

Cheers,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

  reply	other threads:[~2003-04-08  2:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-07  6:45 Rusty Russell
2003-04-07  6:56 ` Christoph Hellwig
2003-04-07  8:34   ` Rusty Russell
2003-04-07 12:49     ` Christoph Hellwig
2003-04-08  1:52       ` Rusty Russell [this message]
2003-04-07 11:21 ` Alan Cox
2003-04-09  2:07   ` Rusty Russell
  -- strict thread matches above, loose matches on Subject: below --
2003-04-07  2:40 Rusty Russell
2003-04-07  2:29 ` Paul Mackerras
2003-04-07  5:58 ` Christoph Hellwig
2003-04-07  5:09   ` Paul Mackerras
2003-04-07  6:21     ` Christoph Hellwig
2003-04-07  6:05       ` Paul Mackerras
2003-04-07 11:24         ` Alan Cox
2003-04-07 20:41 ` Tom Rini

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=20030408021238.F19C42C66E@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=fabrice.bellard@free.fr \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=paulus@au1.ibm.com \
    /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

all inboxes | Powered by JetHome®