WSL2-Linux-Kernel/arch/x86/mm
Arjan van de Ven ae531c26c5 x86: introduce /dev/mem restrictions with a config option
This patch introduces a restriction on /dev/mem: Only non-memory can be
read or written unless the newly introduced config option is set.

The X server needs access to /dev/mem for the PCI space, but it doesn't need
access to memory; both the file permissions and SELinux permissions of /dev/mem
just make X effectively super-super powerful. With the exception of the
BIOS area, there's just no valid app that uses /dev/mem on actual memory.
Other popular users of /dev/mem are rootkits and the like.
(note: mmap access of memory via /dev/mem was already not allowed since
a really long time)

People who want to use /dev/mem for kernel debugging can enable the config
option.

The restrictions of this patch have been in the Fedora and RHEL kernels for
at least 4 years without any problems.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-04-24 23:40:47 +02:00
..
Makefile x86: PAT infrastructure patch 2008-04-17 17:41:19 +02:00
discontig_32.c x86: rename find_max_pfn() to propagate_e820_map() 2008-04-19 19:19:55 +02:00
dump_pagetables.c x86: sort address_markers for dump_pagetables 2008-04-17 17:40:58 +02:00
extable.c x86: unify extable_{32|64}.c 2008-01-30 13:31:41 +01:00
fault.c x86: cleanup - rename VM_MASK to X86_VM_MASK 2008-04-17 17:41:33 +02:00
highmem_32.c Avoid false positive warnings in kmap_atomic_prot() with DEBUG_HIGHMEM 2008-03-28 13:08:14 -07:00
hugetlbpage.c x86: stricter check in follow_huge_addr() 2008-03-27 16:08:45 +01:00
init_32.c x86: introduce /dev/mem restrictions with a config option 2008-04-24 23:40:47 +02:00
init_64.c x86: introduce /dev/mem restrictions with a config option 2008-04-24 23:40:47 +02:00
ioremap.c x86: fix arch/x86/mm/ioremap.c warning 2008-04-19 19:19:54 +02:00
k8topology_64.c srat, x86: add support for nodes spanning other nodes 2008-04-19 19:19:55 +02:00
mmap.c x86: unify mmap_{32|64}.c 2008-01-30 13:31:10 +01:00
numa_64.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-devel 2008-04-21 15:40:24 -07:00
pageattr-test.c x86: remove over noisy debug printk 2008-02-11 11:24:24 -08:00
pageattr.c x86 PAT: fix mmap() of holes 2008-04-18 23:40:49 +02:00
pat.c x86: pat cpu feature bit setting for known cpus 2008-04-17 17:41:20 +02:00
pgtable_32.c x86: remove pointless comments 2008-04-19 19:19:54 +02:00
srat_64.c srat, x86: add support for nodes spanning other nodes 2008-04-19 19:19:55 +02:00