mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
perf/hw_breakpoint: Fix arch_hw_breakpoint use-before-initialization
If we disable the compiler's auto-initialization feature, if
-fplugin-arg-structleak_plugin-byref or -ftrivial-auto-var-init=pattern
are disabled, arch_hw_breakpoint may be used before initialization after:
9a4903dde2 ("perf/hw_breakpoint: Split attribute parse and commit")
On our ARM platform, the struct step_ctrl in arch_hw_breakpoint, which
used to be zero-initialized by kzalloc(), may be used in
arch_install_hw_breakpoint() without initialization.
Signed-off-by: Mark-PK Tsai <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Alix Wu <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: YJ Chiang <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
[ Minor edits. ]
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
0f4cd769c4
commit
310aa0a25b
1 changed files with 2 additions and 2 deletions
|
|
@ -413,7 +413,7 @@ static int hw_breakpoint_parse(struct perf_event *bp,
|
|||
|
||||
int register_perf_hw_breakpoint(struct perf_event *bp)
|
||||
{
|
||||
struct arch_hw_breakpoint hw;
|
||||
struct arch_hw_breakpoint hw = { };
|
||||
int err;
|
||||
|
||||
err = reserve_bp_slot(bp);
|
||||
|
|
@ -461,7 +461,7 @@ int
|
|||
modify_user_hw_breakpoint_check(struct perf_event *bp, struct perf_event_attr *attr,
|
||||
bool check)
|
||||
{
|
||||
struct arch_hw_breakpoint hw;
|
||||
struct arch_hw_breakpoint hw = { };
|
||||
int err;
|
||||
|
||||
err = hw_breakpoint_parse(bp, attr, &hw);
|
||||
|
|
|
|||
Loading…
Reference in a new issue