kernel-fxtec-pro1x/arch/powerpc/platforms/cell
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
..
spufs fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00
axon_msi.c powerpc/irqdomain: Fix broken NR_IRQ references 2012-04-30 10:45:26 +10:00
beat.c powerpc: Rework set_dabr so it can take a DABRX value as well 2012-09-10 09:59:10 +10:00
beat.h powerpc: Rework set_dabr so it can take a DABRX value as well 2012-09-10 09:59:10 +10:00
beat_htab.c powerpc/mm: Convert virtual address to vpn 2012-09-17 16:31:49 +10:00
beat_hvCall.S powerpc: Merge STK_REG/PARAM/FRAMESIZE 2012-07-10 19:18:03 +10:00
beat_interrupt.c powerpc/irqdomain: Fix broken NR_IRQ references 2012-04-30 10:45:26 +10:00
beat_interrupt.h
beat_iommu.c
beat_spu_priv1.c
beat_syscall.h
beat_udbg.c
beat_wrapper.h
cbe_cpufreq.c
cbe_cpufreq.h
cbe_cpufreq_pervasive.c
cbe_cpufreq_pmi.c
cbe_powerbutton.c
cbe_regs.c
cbe_thermal.c
celleb_pci.c bootmem: fix wrong call parameter for free_bootmem() 2012-12-11 17:22:28 -08:00
celleb_pci.h
celleb_scc.h
celleb_scc_epci.c
celleb_scc_pciex.c
celleb_scc_sio.c powerpc/celleb: Use for_each_compatible_node() macro 2013-01-10 17:00:48 +11:00
celleb_scc_uhc.c
celleb_setup.c
cpufreq_spudemand.c workqueue: make deferrable delayed_work initializer names consistent 2012-08-21 13:18:23 -07:00
interrupt.c
interrupt.h
iommu.c Fix misspellings of "whether" in comments. 2012-11-19 14:31:35 +01:00
Kconfig arch/powerpc/platforms/cell: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:43:13 -08:00
Makefile
pervasive.c powerpc: More fixes for lazy IRQ vs. idle 2012-07-10 19:16:07 +10:00
pervasive.h
pmu.c
qpace_setup.c powerpc: Mark const init data with __initconst instead of __initdata 2012-04-02 14:00:03 +10:00
ras.c
ras.h
setup.c POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
smp.c POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
spider-pci.c
spider-pic.c Fix misspellings of "whether" in comments. 2012-11-19 14:31:35 +01:00
spu_base.c
spu_callbacks.c powerpc: Convert print_symbol to %pSR 2013-01-10 17:01:16 +11:00
spu_fault.c
spu_manage.c
spu_notify.c
spu_priv1_mmio.c
spu_priv1_mmio.h
spu_syscalls.c switch simple cases of fget_light to fdget 2012-09-26 22:20:08 -04:00