Re: [PATCH RFC 2/8] arm64: stacktrace: Add arch_within_stack_frames

2022-04-18 Thread Kees Cook
On Mon, Apr 18, 2022 at 09:22:11PM +0800, He Zhe wrote: > This function checks if the given address range crosses frame boundary. > It is based on the existing x86 algorithm, but implemented via stacktrace. > This can be tested by USERCOPY_STACK_FRAME_FROM and > USERCOPY_STACK_FRAME_TO in lkdtm.

Re: [PATCH v1 07/22] powerpc/ftrace: Use patch_instruction() return directly

2022-04-18 Thread Steven Rostedt
On Mon, 18 Apr 2022 11:51:16 +0530 "Naveen N. Rao" wrote: > > --- a/arch/powerpc/kernel/trace/ftrace.c > > +++ b/arch/powerpc/kernel/trace/ftrace.c > > @@ -78,10 +78,7 @@ ftrace_modify_code(unsigned long ip, ppc_inst_t old, > > ppc_inst_t new) > > } > > > > /* replace the text with the

Re: [PATCH 1/2] of: Create platform devices for OF framebuffers

2022-04-18 Thread Thomas Zimmermann
Hi Am 13.04.22 um 14:51 schrieb Rob Herring: ... + /** * of_platform_populate() - Populate platform_devices from device tree data * @root: parent of the first level to probe or NULL for the root of the tree @@ -541,9 +595,7 @@ static int __init of_platform_default_populate_init(void)

[PATCH v3] PCI/AER: Handle Multi UnCorrectable/Correctable errors properly

2022-04-18 Thread Kuppuswamy Sathyanarayanan
Currently the aer_irq() handler returns IRQ_NONE for cases without bits PCI_ERR_ROOT_UNCOR_RCV or PCI_ERR_ROOT_COR_RCV are set. But this assumption is incorrect. Consider a scenario where aer_irq() is triggered for a correctable error, and while we process the error and before we clear the error

[PATCH V2 2/2] powerpc/perf: Fix the power10 event alternatives array to have correct sort order

2022-04-18 Thread Athira Rajeev
When scheduling a group of events, there are constraint checks done to make sure all events can go in a group. Example, one of the criteria is that events in a group cannot use same PMC. But platform specific PMU supports alternative event for some of the event codes. During perf_event_open, if

[PATCH V2 1/2] powerpc/perf: Fix the power9 event alternatives array to have correct sort order

2022-04-18 Thread Athira Rajeev
When scheduling a group of events, there are constraint checks done to make sure all events can go in a group. Example, one of the criteria is that events in a group cannot use same PMC. But platform specific PMU supports alternative event for some of the event codes. During perf_event_open, if

[Bug 215862] New: clang-14 fails 5.18-rc3 ppc64 BE kernel build - :0: error: expected relocatable expression

2022-04-18 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=215862 Bug ID: 215862 Summary: clang-14 fails 5.18-rc3 ppc64 BE kernel build - :0: error: expected relocatable expression Product: Platform Specific/Hardware Version: 2.5 Kernel

[Bug 215389] pagealloc: memory corruption at building glibc-2.33 and running its' testsuite

2022-04-18 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=215389 --- Comment #13 from Erhard F. (erhar...@mailbox.org) --- Created attachment 300775 --> https://bugzilla.kernel.org/attachment.cgi?id=300775=edit kernel .config (5.18-rc3, PowerMac G4 DP) -- You may reply to this email to add a comment. You

[Bug 215389] pagealloc: memory corruption at building glibc-2.33 and running its' testsuite

2022-04-18 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=215389 --- Comment #12 from Erhard F. (erhar...@mailbox.org) --- Created attachment 300774 --> https://bugzilla.kernel.org/attachment.cgi?id=300774=edit dmesg (5.18-rc3, PowerMac G4 DP) Another try with running glibc-2.34 testsuite on kernel

[PATCH RFC 1/8] stacktrace: Change callback prototype to pass more information

2022-04-18 Thread He Zhe
Currently stack_trace_consume_fn can only have pc of each frame of the stack. Copying-beyond-the-frame-detection also needs fp of current and previous frame. Other detection algorithm in the future may need more information of the frame. We define a frame_info to include them all.

[PATCH RFC 6/8] s390: stacktrace: Make callbacks use new prototype with frame info

2022-04-18 Thread He Zhe
stack_trace_consume_fn has been changed to bool (*stack_trace_consume_fn)(void *cookie, struct frame_info *fi); to be able to pass more information. Turn to use pc in struct frame_info in arch_stack_walk callbacks without functinoal change. Signed-off-by: He Zhe ---

[PATCH RFC 3/8] arm64: stacktrace: Make callbacks use new prototype with frame info

2022-04-18 Thread He Zhe
stack_trace_consume_fn has been changed to bool (*stack_trace_consume_fn)(void *cookie, struct frame_info *fi); to be able to pass more information. Turn to use pc in struct frame_info in arch_stack_walk callbacks without functinoal change. Signed-off-by: He Zhe ---

[PATCH RFC 2/8] arm64: stacktrace: Add arch_within_stack_frames

2022-04-18 Thread He Zhe
This function checks if the given address range crosses frame boundary. It is based on the existing x86 algorithm, but implemented via stacktrace. This can be tested by USERCOPY_STACK_FRAME_FROM and USERCOPY_STACK_FRAME_TO in lkdtm. Signed-off-by: He Zhe --- arch/arm64/Kconfig

[PATCH RFC 8/8] lkdtm: usercopy: Make USERCOPY_STACK_FRAME_x able to work for all archs

2022-04-18 Thread He Zhe
Currently the way to generate bad frame use depends on stack layout of the architecture and compiler. It happens to work with x86 but does not work with arm64 since it ruins the stack. On x86, the original do_usercopy_stack_callee returns the start address of its local buffer which is located

[PATCH RFC 7/8] x86: stacktrace: Make callbacks use new prototype with frame info

2022-04-18 Thread He Zhe
stack_trace_consume_fn has been changed to bool (*stack_trace_consume_fn)(void *cookie, struct frame_info *fi); to be able to pass more information. Turn to use pc in struct frame_info in arch_stack_walk callbacks without functinoal change. Signed-off-by: He Zhe ---

[PATCH RFC 5/8] riscv: stacktrace: Make callbacks use new prototype with frame info

2022-04-18 Thread He Zhe
stack_trace_consume_fn has been changed to bool (*stack_trace_consume_fn)(void *cookie, struct frame_info *fi); to be able to pass more information. Turn to use pc in struct frame_info in arch_stack_walk callbacks without functinoal change. Signed-off-by: He Zhe ---

[PATCH RFC 0/8] hardened usercopy and stacktrace improvement

2022-04-18 Thread He Zhe
This series is to add copy-beyond-the-frame detection for hardened usercopy for arm64 by adding more arguments to callbacks of stackstrace and by the way more potential checks in the future can be done. This is done by: - Change stacktrace callback prototype to pass more information which

[PATCH RFC 4/8] powerpc: stacktrace: Make callbacks use new prototype with frame info

2022-04-18 Thread He Zhe
stack_trace_consume_fn has been changed to bool (*stack_trace_consume_fn)(void *cookie, struct frame_info *fi); to be able to pass more information. Turn to use pc in struct frame_info in arch_stack_walk callbacks without functinoal change. Signed-off-by: He Zhe ---

[PATCH 4.9 115/218] tty: hvc: fix return value of __setup handler

2022-04-18 Thread Greg Kroah-Hartman
From: Randy Dunlap [ Upstream commit 53819a0d97aace1425bb042829e3446952a9e8a9 ] __setup() handlers should return 1 to indicate that the boot option has been handled or 0 to indicate that it was not handled. Add a pr_warn() message if the option value is invalid and then always return 1. Link:

[PATCH 4.14 144/284] tty: hvc: fix return value of __setup handler

2022-04-18 Thread Greg Kroah-Hartman
From: Randy Dunlap [ Upstream commit 53819a0d97aace1425bb042829e3446952a9e8a9 ] __setup() handlers should return 1 to indicate that the boot option has been handled or 0 to indicate that it was not handled. Add a pr_warn() message if the option value is invalid and then always return 1. Link:

[Bug 215781] Highmem support broken on kernels greater 5.15.x on ppc32?

2022-04-18 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=215781 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Status|NEW |RESOLVED

[Bug 215781] Highmem support broken on kernels greater 5.15.x on ppc32?

2022-04-18 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=215781 --- Comment #5 from Erhard F. (erhar...@mailbox.org) --- Created attachment 300769 --> https://bugzilla.kernel.org/attachment.cgi?id=300769=edit dmesg (5.18-rc3, PowerMac G4 DP) Meanwhile the fixes landed in 5.16.x, 5.17.x and 5.18-rc3 is also

[PATCH v3] tests/nvdimm/ndtest: Simulate nvdimm health, DSC and smart-inject

2022-04-18 Thread Shivaprasad G Bhat
The 'papr_scm' module and 'papr' implementation in libndctl supports PDSMs for reporting PAPR NVDIMM health, dirty-shutdown-count and injecting smart-errors. This patch adds support for those PDSMs in ndtest module so that PDSM specific paths in libndctl can be exercised. Signed-off-by:

[PATCH] misc: ocxl: fix possible double free in ocxl_file_register_afu

2022-04-18 Thread Hangyu Hua
info_release() will be called in device_unregister() when info->dev's reference count is 0. So there is no need to call ocxl_afu_put() and kfree() again. Fix this by adding free_minor() and return to err_unregister error path. Fixes: 75ca758adbaf ("ocxl: Create a clear delineation between ocxl

Re: [PATCH v1 16/22] powerpc/ftrace: Minimise number of #ifdefs

2022-04-18 Thread Naveen N. Rao
Christophe Leroy wrote: A lot of #ifdefs can be replaced by IS_ENABLED() Do so. This requires to have kernel_toc_addr() defined at all time and PPC_INST_LD_TOC as well. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 2 - arch/powerpc/include/asm/module.h

Re: [PATCH v1 13/22] powerpc/ftrace: Use PPC_RAW_xxx() macros instead of opencoding.

2022-04-18 Thread Naveen N. Rao
Christophe Leroy wrote: PPC_RAW_xxx() macros are self explanatory and less error prone than open coding. Use them in ftrace.c Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 3 +++ arch/powerpc/kernel/trace/ftrace.c| 32 +-- 2 files

Re: [PATCH v1 10/22] powerpc/ftrace: Use CONFIG_FUNCTION_TRACER instead of CONFIG_DYNAMIC_FTRACE

2022-04-18 Thread Naveen N. Rao
Christophe Leroy wrote: Since commit 0c0c52306f47 ("powerpc: Only support DYNAMIC_FTRACE not static"), CONFIG_DYNAMIC_FTRACE is always selected when CONFIG_FUNCTION_TRACER is selected. To avoid confusion and have the reader wonder what's happen when CONFIG_FUNCTION_TRACER is selected and

Re: [PATCH v1 08/22] powerpc/ftrace: Make __ftrace_make_{nop/call}() common to PPC32 and PPC64

2022-04-18 Thread Naveen N. Rao
Christophe Leroy wrote: Since c93d4f6ecf4b ("powerpc/ftrace: Add module_trampoline_target() for PPC32"), __ftrace_make_nop() for PPC32 is very similar to the one for PPC64. Same for __ftrace_make_call(). Make them common. Signed-off-by: Christophe Leroy ---

Re: [PATCH v1 07/22] powerpc/ftrace: Use patch_instruction() return directly

2022-04-18 Thread Naveen N. Rao
Christophe Leroy wrote: Instead of returning -EPERM when patch_instruction() fails, just return what patch_instruction returns. That simplifies ftrace_modify_code(): 0: 94 21 ff c0 stwur1,-64(r1) 4: 93 e1 00 3c stw r31,60(r1) 8: 7c 7f 1b

Re: [PATCH v1 06/22] powerpc/ftrace: Inline ftrace_modify_code()

2022-04-18 Thread Naveen N. Rao
Christophe Leroy wrote: Inlining ftrace_modify_code(), it increases a bit the size of ftrace code but brings 5% improvment on ftrace activation. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git