]> git.proxmox.com Git - mirror_zfs.git/commit
Use env, not sh in zfsctl_snapshot_{,un}mount()
authorStian Ellingsen <stian@plaimi.net>
Thu, 6 Oct 2016 18:03:41 +0000 (20:03 +0200)
committerStian Ellingsen <stian@plaimi.net>
Sat, 8 Oct 2016 15:43:29 +0000 (17:43 +0200)
commit5dc1ff29ec385bc58d76e76bb367d4391c6ee155
treee1185a5f032766dc67703b8467ecdf047d526373
parent00b65db711021d60cc4df57f327d1443ea54a9e1
Use env, not sh in zfsctl_snapshot_{,un}mount()

Call mount and umount via /usr/bin/env instead of /bin/sh in
zfsctl_snapshot_mount() and zfsctl_snapshot_unmount().

This change fixes a shell code injection flaw.  The call to /bin/sh
passed the mountpoint unescaped, only surrounded by single quotes.  A
mountpoint containing one or more single quotes would cause the command
to fail or potentially execute arbitrary shell code.

This change also provides compatibility with grsecurity patches.
Grsecurity only allows call_usermodehelper() to use helper binaries in
certain paths.  /usr/bin/* is allowed, /bin/* is not.
module/zfs/zfs_ctldir.c