qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <Laurent@Vivier.EU>
To: Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <rth@twiddle.net>
Cc: Riku Voipio <riku.voipio@iki.fi>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 5/6] linux-user: add support of binfmt_misc 'O' flag
Date: Fri, 06 Sep 2013 18:50:47 +0200	[thread overview]
Message-ID: <522A07E7.6020205@Vivier.EU> (raw)
In-Reply-To: <CAFEAcA9FDEOtEcGw4FFg2AKzsKuAj3gmYKACcxbHK8NeArActQ@mail.gmail.com>

Le 06/09/2013 18:17, Peter Maydell a écrit :
> On 30 August 2013 00:46, Laurent Vivier <laurent@vivier.eu> wrote:
>> The binfmt_misc module can calculate the credentials and security
>> token according to the binary instead of to the interpreter if the
>> 'C' flag is enabled.
>>
>> To be able to execute non-readable binaries, this flag implies 'O'
>> flag. When 'O' flag is enabled, bintfmt_misc opens the file for
>> reading and pass the file descriptor to the interpreter.
>>
>> References:
>> linux/Documentation/binfmt_misc.txt          ['O' and 'C' description]
>> linux/fs/binfmt_misc.c linux/fs/binfmt_elf.c [ AT_EXECFD usage ]
>> +static int get_execfd(char **envp)
>> +{
>> +    typedef struct {
>> +        long a_type;
>> +        long a_val;
>> +    } auxv_t;
>> +    auxv_t *auxv;
>> +
>> +    while (*envp++ != NULL) {
>> +        ;
>> +    }
>> +
>> +    for (auxv = (auxv_t *)envp; auxv->a_type != AT_NULL; auxv++) {
>> +        if (auxv->a_type == AT_EXECFD) {
>> +            return auxv->a_val;
>> +        }
>> +    }
>> +    return -1;
>> +}
> This looks OK in principle, but this is going to clash
> with RTH's auxval related patchset
> http://patchwork.ozlabs.org/patch/268006/
>
> so some coordination might be a good idea.
Yes, thank you to point this out.

What is the state of this patches series ?

Richard, could you add this as patch #7 ?
I think replacing "get_execfd(envp)" by "qemu_getauxval(AT_EXECFD)" 
should be enough.
Do you want I manage this ?

Regards,
Laurent

  reply	other threads:[~2013-09-06 16:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29 23:46 [Qemu-devel] [PATCH 0/6] linux-user: Misc patches for linux container compatibility Laurent Vivier
2013-08-29 23:46 ` [Qemu-devel] [PATCH 1/6] linux-user: convert /proc/net/route when endianess differs Laurent Vivier
2013-09-06 16:30   ` Peter Maydell
2013-08-29 23:46 ` [Qemu-devel] [PATCH 2/6] linux-user: Add setsockopt(SO_ATTACH_FILTER) Laurent Vivier
2013-09-06 16:30   ` Peter Maydell
2013-08-29 23:46 ` [Qemu-devel] [PATCH 3/6] linux-user: allow use of TIOCGSID Laurent Vivier
2013-09-06 16:31   ` Peter Maydell
2013-08-29 23:46 ` [Qemu-devel] [PATCH 4/6] linux-user: add some IPV6 commands in setsockop() Laurent Vivier
2013-09-06 16:31   ` Peter Maydell
2013-08-29 23:46 ` [Qemu-devel] [PATCH 5/6] linux-user: add support of binfmt_misc 'O' flag Laurent Vivier
2013-09-06 16:17   ` Peter Maydell
2013-09-06 16:50     ` Laurent Vivier [this message]
2013-08-29 23:46 ` [Qemu-devel] [PATCH 6/6] scripts: create a template to use with lxc-create Laurent Vivier
2013-09-06 16:33   ` Peter Maydell
2013-09-06 16:56     ` Laurent Vivier

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=522A07E7.6020205@Vivier.EU \
    --to=laurent@vivier.eu \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=rth@twiddle.net \
    /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).