Ensure that whatever we pass as -t to mount(8) is in a whitelist
authorDavid Zeuthen <davidz@redhat.com>
Thu, 1 Mar 2012 17:06:34 +0000 (12:06 -0500)
committerDavid Zeuthen <davidz@redhat.com>
Thu, 1 Mar 2012 17:06:34 +0000 (12:06 -0500)
commit481965fa36f72b5de0fadda07c1fc47cf348ca7d
tree29eb247bddaf5537eb2a49432cbbac8cdc5e419b
parent3b277903af128fb632897d8932fe300f216ead38
Ensure that whatever we pass as -t to mount(8) is in a whitelist

IOW, ensure that you can't pass e.g. 'nfs../blah' to load the whole NFS
stack. Now we error out, like this

 $ udisksctl mount --block-device /dev/sdc3 -t nfs../blah
 Error mounting /dev/sdc3: GDBus.Error:org.freedesktop.UDisks2.Error.OptionNotPermitted: Requested filesystem type `nfs../blah' is neither well-known nor in /proc/filesystems nor in /etc/filesystems

This is a bug that was already fixed for udisks 1.x, see

 https://bugs.freedesktop.org/show_bug.cgi?id=32232
 CVE-2010-4661: Arbitrary kernel module load

But we apparently forgot to fix this in the move from udisks 1.x to
2.x. Pointed out by Sebastian Krahmer <krahmer@suse.de>, thanks!

Signed-off-by: David Zeuthen <davidz@redhat.com>
src/udiskslinuxfilesystem.c