android_kernel_samsung_msm8976/arch/ia64/kernel
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
..
cpufreq
.gitignore
acpi-ext.c
acpi.c IA64: drivers: remove __dev* attributes. 2013-01-03 15:57:13 -08:00
asm-offsets.c cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
audit.c
brl_emu.c
crash.c
crash_dump.c
cyclone.c
dma-mapping.c
efi.c /dev/mem: use phys_addr_t for physical addresses 2012-10-24 15:32:50 -07:00
efi_stub.S
elfcore.c
entry.h
entry.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
err_inject.c
esi.c
esi_stub.S
fsys.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
fsyscall_gtod_data.h ia64: vsyscall: Use seqcount instead of seqlock 2012-03-15 18:17:59 -07:00
ftrace.c
gate-data.S
gate.lds.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
gate.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
head.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
ia64_ksyms.c treewide: Put a space between #include and FILE 2012-06-28 11:44:36 +02:00
init_task.c
iosapic.c IA64: drivers: remove __dev* attributes. 2013-01-03 15:57:13 -08:00
irq.c
irq_ia64.c random: remove rand_initialize_irq() 2012-07-19 10:38:32 -04:00
irq_lsapic.c
ivt.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
jprobes.S
kprobes.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
machine_kexec.c [IA64] kexec: Move the dereference below the NULL test 2012-09-10 14:31:23 -07:00
machvec.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
Makefile
Makefile.gate
mca.c Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-28 17:19:28 -07:00
mca_asm.S
mca_drv.c userns: On ia64 deal with current_uid and current_gid being kuid and kgid 2012-09-21 03:13:29 -07:00
mca_drv.h
mca_drv_asm.S
minstate.h cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
module.c
msi_ia64.c arch/ia64: remove references to cpu_*_map 2012-03-28 17:14:36 -07:00
nr-irqs.c
numa.c
pal.S
palinfo.c
paravirt.c static keys: Introduce 'struct static_key', static_key_true()/false() and static_key_slow_[inc|dec]() 2012-02-24 10:05:59 +01:00
paravirt_inst.h
paravirt_patch.c
paravirt_patchlist.c
paravirt_patchlist.h
paravirtentry.S
patch.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
pci-dma.c iommu: Remove group_mf 2012-06-25 13:48:30 +02:00
pci-swiotlb.c X86 & IA64: adapt for dma_map_ops changes 2012-03-28 16:36:31 +02:00
perfmon.c fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00
perfmon_default_smpl.c
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h
perfmon_montecito.h
process.c ia64 idle: delete pm_idle 2013-02-17 23:37:06 -05:00
ptrace.c ia64: kill thread_matches(), unexport ptrace_check_attach() 2013-01-20 12:26:05 -08:00
relocate_kernel.S
sal.c
salinfo.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
setup.c ia64 idle: delete pm_idle 2013-02-17 23:37:06 -05:00
sigframe.h
signal.c ia64: switch to generic sigaltstack 2013-02-03 18:15:58 -05:00
smp.c Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-28 17:19:28 -07:00
smpboot.c IA64: drivers: remove __dev* attributes. 2013-01-03 15:57:13 -08:00
stacktrace.c
sys_ia64.c mm: use vm_unmapped_area() on ia64 architecture 2013-02-22 13:46:59 -08:00
time.c kvm: Prepare to add generic guest entry/exit callbacks 2013-01-27 20:35:40 +01:00
topology.c [IA64] Resolve name space collision for cache_show() 2012-11-07 15:51:04 -08:00
traps.c taint: add explicit flag to show whether lock dep is still OK. 2013-01-21 17:17:57 +10:30
unaligned.c
uncached.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
unwind.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
unwind_decoder.c
unwind_i.h
vmlinux.lds.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00