From a16fa77002ac2e972535a2b3a04cb0af6f94e794 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 4 Aug 2023 12:42:30 +0200 Subject: [PATCH] 4.14-stable patches added patches: perf-fix-function-pointer-case.patch --- .../perf-fix-function-pointer-case.patch | 48 +++++++++++++++++++ queue-4.14/series | 1 + 2 files changed, 49 insertions(+) create mode 100644 queue-4.14/perf-fix-function-pointer-case.patch diff --git a/queue-4.14/perf-fix-function-pointer-case.patch b/queue-4.14/perf-fix-function-pointer-case.patch new file mode 100644 index 00000000000..5624c17cee6 --- /dev/null +++ b/queue-4.14/perf-fix-function-pointer-case.patch @@ -0,0 +1,48 @@ +From 1af6239d1d3e61d33fd2f0ba53d3d1a67cc50574 Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Wed, 16 Nov 2022 22:40:17 +0100 +Subject: perf: Fix function pointer case + +From: Peter Zijlstra + +commit 1af6239d1d3e61d33fd2f0ba53d3d1a67cc50574 upstream. + +With the advent of CFI it is no longer acceptible to cast function +pointers. + +The robot complains thusly: + + kernel-events-core.c:warning:cast-from-int-(-)(struct-perf_cpu_pmu_context-)-to-remote_function_f-(aka-int-(-)(void-)-)-converts-to-incompatible-function-type + +Reported-by: kernel test robot +Signed-off-by: Peter Zijlstra (Intel) +Signed-off-by: Cixi Geng +Signed-off-by: Greg Kroah-Hartman +--- + kernel/events/core.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -1096,6 +1096,11 @@ static int perf_mux_hrtimer_restart(stru + return 0; + } + ++static int perf_mux_hrtimer_restart_ipi(void *arg) ++{ ++ return perf_mux_hrtimer_restart(arg); ++} ++ + void perf_pmu_disable(struct pmu *pmu) + { + int *count = this_cpu_ptr(pmu->pmu_disable_count); +@@ -9142,8 +9147,7 @@ perf_event_mux_interval_ms_store(struct + cpuctx = per_cpu_ptr(pmu->pmu_cpu_context, cpu); + cpuctx->hrtimer_interval = ns_to_ktime(NSEC_PER_MSEC * timer); + +- cpu_function_call(cpu, +- (remote_function_f)perf_mux_hrtimer_restart, cpuctx); ++ cpu_function_call(cpu, perf_mux_hrtimer_restart_ipi, cpuctx); + } + cpus_read_unlock(); + mutex_unlock(&mux_interval_mutex); diff --git a/queue-4.14/series b/queue-4.14/series index c235f3cdd85..79c280e44ae 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -178,3 +178,4 @@ drm-client-fix-memory-leak-in-drm_client_target_cloned.patch net-sched-cls_fw-fix-improper-refcount-update-leads-to-use-after-free.patch net-sched-sch_qfq-account-for-stab-overhead-in-qfq_enqueue.patch net-sched-cls_u32-fix-reference-counter-leak-leading-to-overflow.patch +perf-fix-function-pointer-case.patch -- 2.47.3