From: Greg Kroah-Hartman Date: Wed, 12 Sep 2018 18:31:53 +0000 (+0200) Subject: drop 4.18 patch X-Git-Tag: v4.4.156~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4dcec11ed11b99a0b9a8bb0ff006d84e4f1030ca;p=thirdparty%2Fkernel%2Fstable-queue.git drop 4.18 patch --- diff --git a/queue-4.18/perf-python-fix-pyrf_evlist__read_on_cpu-interface.patch b/queue-4.18/perf-python-fix-pyrf_evlist__read_on_cpu-interface.patch deleted file mode 100644 index 4f856067155..00000000000 --- a/queue-4.18/perf-python-fix-pyrf_evlist__read_on_cpu-interface.patch +++ /dev/null @@ -1,102 +0,0 @@ -From foo@baz Tue Sep 11 12:05:55 CEST 2018 -From: Jiri Olsa -Date: Fri, 17 Aug 2018 13:45:56 +0200 -Subject: perf python: Fix pyrf_evlist__read_on_cpu() interface - -From: Jiri Olsa - -[ Upstream commit 721f0dfc3ce821c6a32820ab63edfb48ed4af075 ] - -Jaroslav reported errors from valgrind over perf python script: - - # echo 0 > /sys/devices/system/cpu/cpu4/online - # valgrind ./test.py - ==7524== Memcheck, a memory error detector - ... - ==7524== Command: ./test.py - ==7524== - pid 7526 exited - ==7524== Invalid read of size 8 - ==7524== at 0xCC2C2B3: perf_mmap__read_forward (evlist.c:780) - ==7524== by 0xCC2A681: pyrf_evlist__read_on_cpu (python.c:959) - ... - ==7524== Address 0x65c4868 is 16 bytes after a block of size 459,36.. - ==7524== at 0x4C2B955: calloc (vg_replace_malloc.c:711) - ==7524== by 0xCC2F484: zalloc (util.h:35) - ==7524== by 0xCC2F484: perf_evlist__alloc_mmap (evlist.c:978) - ... - -The reason for this is in the python interface, that allows a script to -pass arbitrary cpu number, which is then used to access struct -perf_evlist::mmap array. That's obviously wrong and works only when if -all cpus are available and fails if some cpu is missing, like in the -example above. - -This patch makes pyrf_evlist__read_on_cpu() search the evlist's maps -array for the proper map to access. - -It's linear search at the moment. Based on the way how is the -read_on_cpu used, I don't think we need to be fast in here. But we -could add some hash in the middle to make it fast/er. - -We don't allow python interface to set write_backward event attribute, -so it's safe to check only evlist's mmaps. - -Reported-by: Jaroslav Å karvada -Signed-off-by: Jiri Olsa -Cc: Alexander Shishkin -Cc: David Ahern -Cc: Joe Mario -Cc: Namhyung Kim -Cc: Peter Zijlstra -Link: http://lkml.kernel.org/r/20180817114556.28000-3-jolsa@kernel.org -Signed-off-by: Arnaldo Carvalho de Melo -Signed-off-by: Sasha Levin -Signed-off-by: Greg Kroah-Hartman ---- - tools/perf/util/python.c | 20 +++++++++++++++++++- - 1 file changed, 19 insertions(+), 1 deletion(-) - ---- a/tools/perf/util/python.c -+++ b/tools/perf/util/python.c -@@ -11,6 +11,7 @@ - #include "cpumap.h" - #include "print_binary.h" - #include "thread_map.h" -+#include "mmap.h" - - #if PY_MAJOR_VERSION < 3 - #define _PyUnicode_FromString(arg) \ -@@ -976,6 +977,20 @@ static PyObject *pyrf_evlist__add(struct - return Py_BuildValue("i", evlist->nr_entries); - } - -+static struct perf_mmap *get_md(struct perf_evlist *evlist, int cpu) -+{ -+ int i; -+ -+ for (i = 0; i < evlist->nr_mmaps; i++) { -+ struct perf_mmap *md = &evlist->mmap[i]; -+ -+ if (md->cpu == cpu) -+ return md; -+ } -+ -+ return NULL; -+} -+ - static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist, - PyObject *args, PyObject *kwargs) - { -@@ -990,7 +1005,10 @@ static PyObject *pyrf_evlist__read_on_cp - &cpu, &sample_id_all)) - return NULL; - -- md = &evlist->mmap[cpu]; -+ md = get_md(evlist, cpu); -+ if (!md) -+ return NULL; -+ - if (perf_mmap__read_init(md) < 0) - goto end; - diff --git a/queue-4.18/series b/queue-4.18/series index 6b26f911e91..8dc8620a52b 100644 --- a/queue-4.18/series +++ b/queue-4.18/series @@ -55,7 +55,6 @@ x86-mce-add-notifier_block-forward-declaration.patch i2c-core-acpi-make-acpi_gsb_i2c_read_bytes-check-i2c_transfer-return-value.patch ib-hfi1-invalid-numa-node-information-can-cause-a-divide-by-zero.patch pwm-meson-fix-mux-clock-names.patch -perf-python-fix-pyrf_evlist__read_on_cpu-interface.patch powerpc-topology-get-topology-for-shared-processors-at-boot.patch mm-fadvise.c-fix-signed-overflow-ubsan-complaint.patch mm-make-deferred_struct_page_init-explicitly-depend-on-sparsemem.patch