Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30046acd authored by Nick Kralevich's avatar Nick Kralevich
Browse files

set O_CLOEXEC on /dev/ashmem

Ensure FDs don't leak across exec() boundaries.

Test: builds and boots. No obvious issues.
Change-Id: I00347b489ddb146b9d33442626f0e89a6cf26551
parent f8bc6cee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ static int __ashmem_open_locked()
    int ret;
    struct stat st;

    int fd = TEMP_FAILURE_RETRY(open(ASHMEM_DEVICE, O_RDWR));
    int fd = TEMP_FAILURE_RETRY(open(ASHMEM_DEVICE, O_RDWR | O_CLOEXEC));
    if (fd < 0) {
        return fd;
    }