From: Greg Kroah-Hartman Date: Wed, 16 Oct 2019 21:34:16 +0000 (-0700) Subject: 4.19-stable patches X-Git-Tag: v4.4.197~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=292db79d71cae32956bcf6e525160ae2a018b832;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: perf-hw_breakpoint-fix-arch_hw_breakpoint-use-before-initialization.patch --- diff --git a/queue-4.19/perf-hw_breakpoint-fix-arch_hw_breakpoint-use-before-initialization.patch b/queue-4.19/perf-hw_breakpoint-fix-arch_hw_breakpoint-use-before-initialization.patch new file mode 100644 index 00000000000..22b7d06be37 --- /dev/null +++ b/queue-4.19/perf-hw_breakpoint-fix-arch_hw_breakpoint-use-before-initialization.patch @@ -0,0 +1,60 @@ +From 310aa0a25b338b3100c94880c9a69bec8ce8c3ae Mon Sep 17 00:00:00 2001 +From: Mark-PK Tsai +Date: Fri, 6 Sep 2019 14:01:16 +0800 +Subject: perf/hw_breakpoint: Fix arch_hw_breakpoint use-before-initialization + +From: Mark-PK Tsai + +commit 310aa0a25b338b3100c94880c9a69bec8ce8c3ae upstream. + +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: + + 9a4903dde2c86 ("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 +Cc: Alexander Shishkin +Cc: Alix Wu +Cc: Arnaldo Carvalho de Melo +Cc: Jiri Olsa +Cc: Linus Torvalds +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: YJ Chiang +Link: https://lkml.kernel.org/r/20190906060115.9460-1-mark-pk.tsai@mediatek.com +[ Minor edits. ] +Signed-off-by: Ingo Molnar +Cc: Doug Anderson +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/events/hw_breakpoint.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/events/hw_breakpoint.c ++++ b/kernel/events/hw_breakpoint.c +@@ -426,7 +426,7 @@ static int hw_breakpoint_parse(struct pe + + 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); +@@ -474,7 +474,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); diff --git a/queue-4.19/series b/queue-4.19/series index 5a6372698ef..f19f9c0fd8a 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -78,3 +78,4 @@ tracing-get-trace_array-reference-for-available_tracers-files.patch hwmon-fix-hwmon_p_min_alarm-mask.patch x86-asm-fix-mwaitx-c-state-hint-value.patch pci-vmd-fix-config-addressing-when-using-bus-offsets.patch +perf-hw_breakpoint-fix-arch_hw_breakpoint-use-before-initialization.patch