summaryrefslogtreecommitdiffstats
path: root/drivers/misc/lkdtm_perms.c
Commit message (Collapse)AuthorAgeFilesLines
* lkdtm: Do not use flush_icache_range() on user addressesCatalin Marinas2016-11-101-2/+5
| | | | | | | | | | | | | | | | | | | The flush_icache_range() API is meant to be used on kernel addresses only as it may not have the infrastructure (exception entries) to handle user memory faults. The lkdtm execute_user_location() function tests the kernel execution of user space addresses by mmap'ing an anonymous page, copying some code together with cache maintenance and attempting to run it. However, the cache maintenance step may fail because of the incorrect API usage described above. The patch changes lkdtm to use access_process_vm() for copying the code into user space which would take care of the necessary cache maintenance. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> [kees: export access_process_vm() for module use] Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* lkdtm: silence warnings about function declarationsKees Cook2016-07-151-5/+1
| | | | | | | | | When building under W=1, the lack of lkdtm.h in lkdtm_usercopy.c and lkdtm_rodata.c was discovered. This fixes the issue and consolidates the common header and the pr_fmt macro for simplicity and regularity across each test source file. Signed-off-by: Kees Cook <keescook@chromium.org>
* lkdtm: split memory permissions tests to separate fileKees Cook2016-07-071-0/+203
This splits the EXEC_*, WRITE_* and related tests into the new lkdtm_perms.c file to help separate things better for readability. Signed-off-by: Kees Cook <keescook@chromium.org>
OpenPOWER on IntegriCloud