Linux-ARM-Kernel Archive on
 help / color / Atom feed
From: (Robin Murphy)
Subject: [PATCH] arm64: fix kernel panic on serror exception caused by user process
Date: Tue, 17 Jul 2018 15:26:45 +0100
Message-ID: <> (raw)
In-Reply-To: <>

On 17/07/18 14:40, Hari Vyas wrote:
>> Sorry, but this is simply a risk of exposing /dev/mem to userspace.
>> The user could also use devmem to poke devices in ways which could
>> permanently damage them. If you cannot trust the user to not do such
>> things, you must not give them access to /dev/mem.
> Okay. Don't think it is a question of trust. If access happens from
> kernel mode, I understand but If user mode initiated
> access(from devmem(which is just an example) or any other application)
> into outside or invalid region of system
> address brings complete kernel down, at least I will be surprised.

If you have an Arm Juno board, why not try this fun little demonstration 
I once wrote for a colleague:

#include <fcntl.h>
#include <sys/mman.h>

int main(void) {
	int *dmc, fd = open("/dev/mem", O_RDWR|O_SYNC);
	dmc = mmap(0, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0x2b0a0000);
	dmc[2] = 1;

The simple fact is that anyone with access to /dev/mem *can* take down 
the system any number of ways. It's foolish to think there's any way of 
protecting against that other than by not giving them access at all.


[ For anyone interested, it puts the DRAM controller into sleep mode. 
The kernel can't even panic if all the memory suddenly disappears :D ]

  parent reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17  9:31 [PATCH] arm64: fix kernel panic on serror " Hari Vyas
2018-07-17  9:31 ` [PATCH] arm64: fix kernel panic on serror exception " Hari Vyas
2018-07-17 10:06   ` Mark Rutland
2018-07-17 11:32     ` Hari Vyas
2018-07-17 11:48       ` Mark Rutland
2018-07-17 13:40         ` Hari Vyas
2018-07-17 14:20           ` James Morse
2018-07-17 14:26           ` Robin Murphy [this message]
2018-07-17 14:45           ` Russell King - ARM Linux
2018-07-18  9:14             ` Hari Vyas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-ARM-Kernel Archive on

Archives are clonable:
	git clone --mirror linux-arm-kernel/git/0.git
	git clone --mirror linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ \
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone