qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 5/6] linux-user: add support of binfmt_misc 'O'


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 5/6] linux-user: add support of binfmt_misc 'O' flag
Date: Fri, 6 Sep 2013 17:17:26 +0100

On 30 August 2013 00:46, Laurent Vivier <address@hidden> 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.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]