Re: [PATCH] [v2] selftests: powerpc: Remove unneeded variables

2021-05-16 Thread Michael Ellerman
Wan Jiabing writes: > Fix coccicheck warning: > > ./tools/testing/selftests/powerpc/alignment/alignment_handler.c:539:5-7: > Unneeded variable: "rc". Return "0" on line 562 > ./tools/testing/selftests/powerpc/alignment/alignment_handler.c:567:5-7: > Unneeded variable: "rc". Return "0" on line 580

Re: Fwd: [Bug 213069] New: kernel BUG at arch/powerpc/include/asm/book3s/64/hash-4k.h:147! Oops: Exception in kernel mode, sig: 5 [#1]

2021-05-16 Thread Aneesh Kumar K.V
On 5/17/21 11:17 AM, Christophe Leroy wrote: +aneesh +linuxppc-dev list Le 17/05/2021 à 07:44, Anshuman Khandual a écrit : Hello Christophe, DEBUG_VM_PGTABLE has now been re-enabled on powerpc recently ? was not aware about this. From the error log, it failed explicitly on 4K page size hash

Re: Fwd: [Bug 213069] New: kernel BUG at arch/powerpc/include/asm/book3s/64/hash-4k.h:147! Oops: Exception in kernel mode, sig: 5 [#1]

2021-05-16 Thread Christophe Leroy
+aneesh +linuxppc-dev list Le 17/05/2021 à 07:44, Anshuman Khandual a écrit : Hello Christophe, DEBUG_VM_PGTABLE has now been re-enabled on powerpc recently ? was not aware about this. From the error log, it failed explicitly on 4K page size hash config. static inline pmd_t

[PATCH v14 9/9] powerpc/32: use set_memory_attr()

2021-05-16 Thread Jordan Niethe
From: Christophe Leroy Use set_memory_attr() instead of the PPC32 specific change_page_attr() change_page_attr() was checking that the address was not mapped by blocks and was handling highmem, but that's unneeded because the affected pages can't be in highmem and block mapping verification is

[PATCH v14 8/9] powerpc/mm: implement set_memory_attr()

2021-05-16 Thread Jordan Niethe
From: Christophe Leroy In addition to the set_memory_xx() functions which allows to change the memory attributes of not (yet) used memory regions, implement a set_memory_attr() function to: - set the final memory protection after init on currently used kernel regions. - enable/disable kernel

[PATCH v14 7/9] powerpc: Set ARCH_HAS_STRICT_MODULE_RWX

2021-05-16 Thread Jordan Niethe
From: Russell Currey To enable strict module RWX on powerpc, set: CONFIG_STRICT_MODULE_RWX=y You should also have CONFIG_STRICT_KERNEL_RWX=y set to have any real security benefit. ARCH_HAS_STRICT_MODULE_RWX is set to require ARCH_HAS_STRICT_KERNEL_RWX. This is due to a quirk in

[PATCH v14 6/9] powerpc/bpf: Write protect JIT code

2021-05-16 Thread Jordan Niethe
Add the necessary call to bpf_jit_binary_lock_ro() to remove write and add exec permissions to the JIT image after it has finished being written. Without CONFIG_STRICT_MODULE_RWX the image will be writable and executable until the call to bpf_jit_binary_lock_ro(). Reviewed-by: Christophe Leroy

[PATCH v14 5/9] powerpc/bpf: Remove bpf_jit_free()

2021-05-16 Thread Jordan Niethe
Commit 74451e66d516 ("bpf: make jited programs visible in traces") added a default bpf_jit_free() implementation. Powerpc did not use the default bpf_jit_free() as powerpc did not set the images read-only. The default bpf_jit_free() called bpf_jit_binary_unlock_ro() is why it could not be used for

[PATCH v14 4/9] powerpc/kprobes: Mark newly allocated probes as ROX

2021-05-16 Thread Jordan Niethe
From: Russell Currey Add the arch specific insn page allocator for powerpc. This allocates ROX pages if STRICT_KERNEL_RWX is enabled. These pages are only written to with patch_instruction() which is able to write RO pages. Reviewed-by: Daniel Axtens Signed-off-by: Russell Currey

[PATCH v14 3/9] powerpc/modules: Make module_alloc() Strict Module RWX aware

2021-05-16 Thread Jordan Niethe
Make module_alloc() use PAGE_KERNEL protections instead of PAGE_KERNEL_EXEX if Strict Module RWX is enabled. Signed-off-by: Jordan Niethe --- v14: - Split out from powerpc: Set ARCH_HAS_STRICT_MODULE_RWX - Add and use strict_module_rwx_enabled() helper --- arch/powerpc/include/asm/mmu.h |

[PATCH v14 2/9] powerpc/lib/code-patching: Set up Strict RWX patching earlier

2021-05-16 Thread Jordan Niethe
setup_text_poke_area() is a late init call so it runs before mark_rodata_ro() and after the init calls. This lets all the init code patching simply write to their locations. In the future, kprobes is going to allocate its instruction pages RO which means they will need setup_text__poke_area() to

[PATCH v14 1/9] powerpc/mm: Implement set_memory() routines

2021-05-16 Thread Jordan Niethe
From: Russell Currey The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX, and are generally useful primitives to have. This implementation is designed to be generic across powerpc's many MMUs. It's possible that this could be optimised to be faster for specific MMUs.

[PATCH v14 0/9] powerpc: Further Strict RWX support

2021-05-16 Thread Jordan Niethe
Adding more Strict RWX support on powerpc, in particular Strict Module RWX. Thanks for all of the feedback everyone. It is now rebased on linux-next + powerpc/64s/radix: Enable huge vmalloc mappings (https://lore.kernel.org/linuxppc-dev/20210503091755.613393-1-npig...@gmail.com/) For reference

Re: [PATCH kernel v3] powerpc/makefile: Do not redefine $(CPP) for preprocessor

2021-05-16 Thread Alexey Kardashevskiy
On 5/14/21 18:46, Segher Boessenkool wrote: Hi! On Fri, May 14, 2021 at 11:42:32AM +0900, Masahiro Yamada wrote: In my best guess, the reason why powerpc adding the endian flag to CPP is this line in arch/powerpc/kernel/vdso64/vdso64.lds.S #ifdef __LITTLE_ENDIAN__

Re: [PATCH V2 1/1] powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC

2021-05-16 Thread Nicholas Piggin
Sorry I missed this :( Excerpts from Athira Rajeev's message of April 20, 2021 1:01 pm: > Running perf fuzzer showed below in dmesg logs: > "Can't find PMC that caused IRQ" > > This means a PMU exception happened, but none of the PMC's (Performance > Monitor Counter) were found to be overflown.

Re: [PATCH v13 6/8] powerpc: Set ARCH_HAS_STRICT_MODULE_RWX

2021-05-16 Thread Jordan Niethe
On Fri, May 14, 2021 at 3:50 PM Christophe Leroy wrote: > > > > Le 10/05/2021 à 03:18, Jordan Niethe a écrit : > > From: Russell Currey > > > > To enable strict module RWX on powerpc, set: > > > > CONFIG_STRICT_MODULE_RWX=y > > > > You should also have CONFIG_STRICT_KERNEL_RWX=y set to have

[powerpc:merge] BUILD SUCCESS 3a81c0495fdb91fd9a9b4f617098c283131eeae1

2021-05-16 Thread kernel test robot
allmodconfig powerpc allnoconfig x86_64 randconfig-a004-20210516 x86_64 randconfig-a003-20210516 x86_64 randconfig-a001-20210516 x86_64 randconfig-a005-20210516 x86_64 randconfig-a002-20210516

[powerpc:next-test] BUILD SUCCESS 4938c440ff7f2c27641f6639d1202f52759ea3ff

2021-05-16 Thread kernel test robot
allnoconfig x86_64 randconfig-a004-20210516 x86_64 randconfig-a003-20210516 x86_64 randconfig-a001-20210516 x86_64 randconfig-a005-20210516 x86_64 randconfig-a002-20210516 x86_64 randconfig-a006