]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
seccomp: open memfd read-write 3092/head
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 16 Jul 2019 09:22:50 +0000 (11:22 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 16 Jul 2019 12:59:18 +0000 (14:59 +0200)
Makes it easier to implement syscalls which need to write to
a buffer passed by user space as a pointer.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/lxc/seccomp.c

index aa45b0cf608ad0a5c086f5146c458fb5e1b85d6b..00d533e0f9cfa14a06ecf3502e39bed007c58eff 100644 (file)
@@ -1400,7 +1400,7 @@ int seccomp_notify_handler(int fd, uint32_t events, void *data,
        }
 
        snprintf(mem_path, sizeof(mem_path), "/proc/%d/mem", req->pid);
-       fd_mem = open(mem_path, O_RDONLY | O_CLOEXEC);
+       fd_mem = open(mem_path, O_RDWR | O_CLOEXEC);
        if (fd_mem < 0) {
                seccomp_notify_default_answer(fd, req, resp, hdlr);
                SYSERROR("Failed to open process memory for seccomp notify request");