[PATCH -next] i2c: sprd: Fix PM reference leak in sprd_i2c_master_xfer()

2021-04-08 Thread Li Huafei
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Reported-by: Hulk Robot Signed-off-by: Li Huafei --- drivers/i2c/busses

[PATCH -next] i2c: omap: fix PM reference leak in omap_i2c_probe()

2021-04-08 Thread Li Huafei
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Reported-by: Hulk Robot Signed-off-by: Li Huafei --- drivers/i2c/busses

[PATCH -next] powerpc/mce: Make symbol 'mce_ue_event_work' static

2021-04-07 Thread Li Huafei
The sparse tool complains as follows: arch/powerpc/kernel/mce.c:43:1: warning: symbol 'mce_ue_event_work' was not declared. Should it be static? This symbol is not used outside of mce.c, so this commit marks it static. Signed-off-by: Li Huafei --- arch/powerpc/kernel/mce.c | 2

[PATCH -next] powerpc/security: Make symbol 'stf_barrier' static

2021-04-07 Thread Li Huafei
The sparse tool complains as follows: arch/powerpc/kernel/security.c:253:6: warning: symbol 'stf_barrier' was not declared. Should it be static? This symbol is not used outside of security.c, so this commit marks it static. Signed-off-by: Li Huafei --- arch/powerpc/kernel/secu

Re: [PATCH] ima: Fix the error code for restoring the PCR value

2021-03-23 Thread Li Huafei
ping. :-) On 2021/3/3 11:28, Li Huafei wrote: In ima_restore_measurement_list(), hdr[HDR_PCR].data is pointing to a buffer of type u8, which contains the dumped 32-bit pcr value. Currently, only the least significant byte is used to restore the pcr value. We should convert hdr[HDR_PCR].data to

[PATCH 1/2] ftrace: Update ftrace_ops->next pointer with rcu_assign_pointer()

2021-03-17 Thread Li Huafei
The unregistered ftrace_ops may be freed by the caller, so we should use rcu_assign_pointer() in remove_ftrace_ops() to remove the ftrace_ops, which ensures that no more users will reference the ftrace_ops after synchronize_rcu() is called. Signed-off-by: Li Huafei --- kernel/trace/ftrace.c | 4

[PATCH 0/2] Fix the race on &event->ftrace_ops between perf and ftrace

2021-03-17 Thread Li Huafei
is race condition was triggered when we did the fuzz test, see the commit message of PATCH 2 for detailed logs. This patch set fixes this race. Li Huafei (2): ftrace: Update ftrace_ops->next pointer with rcu_assign_pointer() perf, ftrace: Fix use-after-free in __ftrace_ops_list_func() inc

[PATCH 2/2] perf, ftrace: Fix use-after-free in __ftrace_ops_list_func()

2021-03-17 Thread Li Huafei
chronization directly in unregister_ftrace_function() is that for some users whose registered ftrace_ops is static, synchronization is not necessary for them and is performance intensive, so we add a separate interface. Signed-off-by: Li Huafei --- include/linux/ftrace.h | 15 +++ kernel/

[PATCH] ima: Fix the error code for restoring the PCR value

2021-03-03 Thread Li Huafei
to restore the correct pcr value. Fixes: 47fdee60b47f ("ima: use ima_parse_buf() to parse measurements headers") Signed-off-by: Li Huafei --- security/integrity/ima/ima_template.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/integrity/ima/ima_tem

Re: [PATCH] recordmcount: Fix the wrong use of w* in arm64_is_fake_mcount()

2021-03-03 Thread Li Huafei
On 2021/3/3 6:30, Steven Rostedt wrote: On Thu, 25 Feb 2021 16:01:17 + Will Deacon wrote: On Thu, Feb 25, 2021 at 09:44:26AM -0500, Steven Rostedt wrote: This requires an acked-by from one of the ARM64 maintainers. -- Steve On Thu, 25 Feb 2021 22:07:47 +0800 Li Huafei wrote

[PATCH] recordmcount: Fix the wrong use of w* in arm64_is_fake_mcount()

2021-02-25 Thread Li Huafei
trace cannot be used. Using w8 to get the value of rp->r_info will fix the problem. Fixes: ea0eada45632 ("recordmcount: only record relocation of type R_AARCH64_CALL26 on arm64") Signed-off-by: Li Huafei --- scripts/recordmcount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(