linux/drivers/xen
Eric W. Biederman 7f78e03513 fs: Limit sys_mount to only request filesystem modules.
Modify the request_module to prefix the file system type with "fs-"
and add aliases to all of the filesystems that can be built as modules
to match.

A common practice is to build all of the kernel code and leave code
that is not commonly needed as modules, with the result that many
users are exposed to any bug anywhere in the kernel.

Looking for filesystems with a fs- prefix limits the pool of possible
modules that can be loaded by mount to just filesystems trivially
making things safer with no real cost.

Using aliases means user space can control the policy of which
filesystem modules are auto-loaded by editing /etc/modprobe.d/*.conf
with blacklist and alias directives.  Allowing simple, safe,
well understood work-arounds to known problematic software.

This also addresses a rare but unfortunate problem where the filesystem
name is not the same as it's module name and module auto-loading
would not work.  While writing this patch I saw a handful of such
cases.  The most significant being autofs that lives in the module
autofs4.

This is relevant to user namespaces because we can reach the request
module in get_fs_type() without having any special permissions, and
people get uncomfortable when a user specified string (in this case
the filesystem type) goes all of the way to request_module.

After having looked at this issue I don't think there is any
particular reason to perform any filtering or permission checks beyond
making it clear in the module request that we want a filesystem
module.  The common pattern in the kernel is to call request_module()
without regards to the users permissions.  In general all a filesystem
module does once loaded is call register_filesystem() and go to sleep.
Which means there is not much attack surface exposed by loading a
filesytem module unless the filesystem is mounted.  In a user
namespace filesystems are not mounted unless .fs_flags = FS_USERNS_MOUNT,
which most filesystems do not set today.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Acked-by: Kees Cook <keescook@chromium.org>
Reported-by: Kees Cook <keescook@google.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2013-03-03 19:36:31 -08:00
..
xen-pciback Two fixes: 2013-02-08 11:55:27 +11:00
xenbus xenbus: fix compile failure on ARM with Xen enabled 2013-03-01 10:55:00 -05:00
xenfs fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00
Kconfig xen/acpi: ACPI cpu hotplug 2013-02-19 22:02:29 -05:00
Makefile xen/acpi: ACPI cpu hotplug 2013-02-19 22:02:29 -05:00
acpi.c xen/acpi/sleep: Enable ACPI sleep via the __acpi_os_prepare_sleep 2012-05-07 15:33:18 -04:00
balloon.c xen: balloon: allow PVMMU interfaces to be compiled out 2012-11-29 12:59:13 +00:00
biomerge.c xen: using EXPORT_SYMBOL requires including export.h 2012-01-18 15:37:49 -08:00
cpu_hotplug.c Xen: properly bound buffer access when parsing cpu/*/availability 2013-01-15 15:57:02 -05:00
dbgp.c xen: dbgp: Fix warning when CONFIG_PCI is not enabled. 2012-10-19 15:19:37 -04:00
events.c Features: 2013-02-24 16:18:31 -08:00
evtchn.c xen: close evtchn port if binding to irq fails 2013-02-19 22:02:33 -05:00
fallback.c xen/hypercall: fix hypercall fallback code for very old hypervisors 2012-11-04 10:40:42 -05:00
features.c xen: clean up asm/xen/hypervisor.h 2008-12-16 21:50:31 +01:00
gntalloc.c mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
gntdev.c xen/gntdev: remove erronous use of copy_to_user 2013-01-15 16:02:40 -05:00
grant-table.c xen: introduce xen_remap, use it instead of ioremap 2013-02-19 22:02:34 -05:00
manage.c xen/resume: Fix compile warnings. 2012-04-19 15:12:49 -04:00
mcelog.c xen/mce: add .poll method for mcelog device driver 2012-07-19 15:51:41 -04:00
pci.c xen/pci: Check for PCI bridge before using it. 2012-05-30 10:16:35 -04:00
pcpu.c Features: 2013-02-24 16:18:31 -08:00
platform-pci.c Drivers: xen: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
privcmd.c xen/privcmd: Fix mmap batch ioctl. 2013-01-15 16:00:52 -05:00
privcmd.h xen: Add privcmd device driver 2011-12-16 13:29:31 -05:00
swiotlb-xen.c x86: Don't panic if can not alloc buffer for swiotlb 2013-01-29 19:36:53 -08:00
sys-hypervisor.c xen: sysfs: fix build warning. 2012-10-19 15:17:51 -04:00
tmem.c xen/tmem: Add missing %s in the printk statement. 2013-02-19 22:02:31 -05:00
xen-acpi-cpuhotplug.c xen/acpi: xen cpu hotplug minor updates 2013-02-25 07:44:29 -05:00
xen-acpi-memhotplug.c xen/acpi: xen memory hotplug minor updates 2013-02-25 07:44:21 -05:00
xen-acpi-pad.c ACPI: Remove useless type argument of driver .remove() operation 2013-01-26 00:37:24 +01:00
xen-acpi-processor.c cpuidle / ACPI : remove power from acpi_processor_cx structure 2012-09-05 15:13:48 +02:00
xen-balloon.c Features: 2012-03-22 20:16:14 -07:00
xen-selfballoon.c mm: export a function to get vm committed memory 2012-11-15 15:41:22 -08:00
xen-stub.c xen/stub: driver for CPU hotplug 2013-02-19 22:02:27 -05:00
xencomm.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00