Restrict /dev/{mem,kmem,port} when the kernel is locked down
authorMatthew Garrett <mjg59@srcf.ucam.org>
Mon, 18 Feb 2019 12:44:58 +0000 (12:44 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 21 Aug 2019 12:48:11 +0000 (13:48 +0100)
commita511ca8a3a6e47e674eccd19e1c6da03e5e16c65
tree5938aaf6df588cd0c9ce6d1c304e89b81ee35106
parent1efdae804a1de3fd2cdd38a2b5151fac370aca13
Restrict /dev/{mem,kmem,port} when the kernel is locked down

Allowing users to read and write to core kernel memory makes it possible
for the kernel to be subverted, avoiding module loading restrictions, and
also to steal cryptographic information.

Disallow /dev/mem and /dev/kmem from being opened this when the kernel has
been locked down to prevent this.

Also disallow /dev/port from being opened to prevent raw ioport access and
thus DMA from being used to accomplish the same thing.

Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: "Lee, Chun-Yi" <jlee@suse.com>
Gbp-Pq: Topic features/all/lockdown
Gbp-Pq: Name 0005-Restrict-dev-mem-kmem-port-when-the-kernel-is-locked.patch
drivers/char/mem.c