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: Laurent Vivier
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8

Le 06/09/2013 18:17, Peter Maydell a écrit :
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.
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 via email to

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