1 From cfe13b7a217075ae741c018da50cd600e5330de2 Mon Sep 17 00:00:00 2001
2 From: Miklos Szeredi <mszeredi@suse.cz>
3 Date: Fri, 22 May 2015 10:58:43 +0200
4 Subject: [PATCH] libfuse: fix exec environment for mount and umount
6 Found by Tavis Ormandy (CVE-2015-3202).
10 @@ -95,10 +95,12 @@ static int add_mount(const char *prognam
16 sigprocmask(SIG_SETMASK, &oldmask, NULL);
18 - execl("/bin/mount", "/bin/mount", "--no-canonicalize", "-i",
19 - "-f", "-t", type, "-o", opts, fsname, mnt, NULL);
20 + execle("/bin/mount", "/bin/mount", "--no-canonicalize", "-i",
21 + "-f", "-t", type, "-o", opts, fsname, mnt, NULL, &env);
22 fprintf(stderr, "%s: failed to execute /bin/mount: %s\n",
23 progname, strerror(errno));
25 @@ -146,10 +148,17 @@ static int exec_umount(const char *progn
31 sigprocmask(SIG_SETMASK, &oldmask, NULL);
33 - execl("/bin/umount", "/bin/umount", "-i", rel_mnt,
34 - lazy ? "-l" : NULL, NULL);
36 + execle("/bin/umount", "/bin/umount", "-i", rel_mnt,
39 + execle("/bin/umount", "/bin/umount", "-i", rel_mnt,
42 fprintf(stderr, "%s: failed to execute /bin/umount: %s\n",
43 progname, strerror(errno));
45 @@ -205,10 +214,12 @@ static int remove_mount(const char *prog
51 sigprocmask(SIG_SETMASK, &oldmask, NULL);
53 - execl("/bin/umount", "/bin/umount", "--no-canonicalize", "-i",
54 - "--fake", mnt, NULL);
55 + execle("/bin/umount", "/bin/umount", "--no-canonicalize", "-i",
56 + "--fake", mnt, NULL, &env);
57 fprintf(stderr, "%s: failed to execute /bin/umount: %s\n",
58 progname, strerror(errno));