kernel-fxtec-pro1x/arch/arc
Eugeniy Paltsev cacbc85376 ARC: mm: SIGSEGV userspace trying to access kernel virtual memory
[ Upstream commit a8c715b4dd73c26a81a9cc8dc792aa715d8b4bb2 ]

As of today if userspace process tries to access a kernel virtual addres
(0x7000_0000 to 0x7ffff_ffff) such that a legit kernel mapping already
exists, that process hangs instead of being killed with SIGSEGV

Fix that by ensuring that do_page_fault() handles kenrel vaddr only if
in kernel mode.

And given this, we can also simplify the code a bit. Now a vmalloc fault
implies kernel mode so its failure (for some reason) can reuse the
@no_context label and we can remove @bad_area_nosemaphore.

Reproduce user test for original problem:

------------------------>8-----------------
 #include <stdlib.h>
 #include <stdint.h>

 int main(int argc, char *argv[])
 {
 	volatile uint32_t temp;

 	temp = *(uint32_t *)(0x70000000);
 }
------------------------>8-----------------

Cc: <stable@vger.kernel.org>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-09-16 08:22:14 +02:00
..
boot ARC: [plat-hsdk]: Add missing FIFO size entry in GMAC node 2019-06-25 11:35:55 +08:00
configs ARC: enable uboot support unconditionally 2019-08-06 19:06:57 +02:00
include ARC: fix build warnings 2019-06-25 11:35:55 +08:00
kernel ARC: show_regs: lockdep: re-enable preemption 2019-09-16 08:22:02 +02:00
lib
mm ARC: mm: SIGSEGV userspace trying to access kernel virtual memory 2019-09-16 08:22:14 +02:00
oprofile
plat-axs10x
plat-eznps
plat-hsdk
plat-sim
plat-tb10x
Kbuild
Kconfig ARC: enable uboot support unconditionally 2019-08-06 19:06:57 +02:00
Kconfig.debug
Makefile