From: Sasha Levin Date: Mon, 28 Sep 2020 22:02:10 +0000 (-0400) Subject: Drop perf-parse-events-fix-incorrect-conversion-of-if-fre.patch X-Git-Tag: v4.4.238~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=58bee6beb129f220a6e4d34688c9ecc02a8c1415;p=thirdparty%2Fkernel%2Fstable-queue.git Drop perf-parse-events-fix-incorrect-conversion-of-if-fre.patch Signed-off-by: Sasha Levin --- diff --git a/queue-4.14/perf-parse-events-fix-incorrect-conversion-of-if-fre.patch b/queue-4.14/perf-parse-events-fix-incorrect-conversion-of-if-fre.patch deleted file mode 100644 index 650b9d6a431..00000000000 --- a/queue-4.14/perf-parse-events-fix-incorrect-conversion-of-if-fre.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 638f036a2ae802a8267b15e23733500fb5cfa14b Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 13 May 2020 10:20:26 -0300 -Subject: perf parse-events: Fix incorrect conversion of 'if () free()' to - 'zfree()' - -From: Arnaldo Carvalho de Melo - -[ Upstream commit 7fcdccd4237724931d9773d1e3039bfe053a6f52 ] - -When applying a patch by Ian I incorrectly converted to zfree() an -expression that involved testing some other struct member, not the one -being freed, which lead to bugs reproduceable by: - - $ perf stat -e i/bs,tsc,L2/o sleep 1 - WARNING: multiple event parsing errors - Segmentation fault (core dumped) - $ - -Fix it by restoring the test for pos->free_str before freeing -pos->val.str, but continue using zfree(&pos->val.str) to set that member -to NULL after freeing it. - -Reported-by: Ian Rogers -Fixes: e8dfb81838b1 ("perf parse-events: Fix memory leaks found on parse_events") -Cc: Adrian Hunter -Cc: Alexander Shishkin -Cc: Andi Kleen -Cc: clang-built-linux@googlegroups.com -Cc: Jiri Olsa -Cc: Leo Yan -Cc: Mark Rutland -Cc: Namhyung Kim -Cc: Peter Zijlstra -Cc: Stephane Eranian -Signed-off-by: Arnaldo Carvalho de Melo -Signed-off-by: Sasha Levin ---- - tools/perf/util/parse-events.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c -index 2733cdfdf04c6..ba973bdfaa657 100644 ---- a/tools/perf/util/parse-events.c -+++ b/tools/perf/util/parse-events.c -@@ -1258,7 +1258,8 @@ static int __parse_events_add_pmu(struct parse_events_state *parse_state, - - list_for_each_entry_safe(pos, tmp, &config_terms, list) { - list_del_init(&pos->list); -- zfree(&pos->val.str); -+ if (pos->free_str) -+ zfree(&pos->val.str); - free(pos); - } - return -EINVAL; --- -2.25.1 - diff --git a/queue-4.14/series b/queue-4.14/series index 37ea70d26bc..771fca34a82 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -126,7 +126,6 @@ printk-handle-blank-console-arguments-passed-in.patch usb-dwc3-increase-timeout-for-cmdact-cleared-by-devi.patch btrfs-don-t-force-read-only-after-error-in-drop-snap.patch vfio-pci-fix-memory-leaks-of-eventfd-ctx.patch -perf-parse-events-fix-incorrect-conversion-of-if-fre.patch perf-util-fix-memory-leak-of-prefix_if_not_in.patch perf-kcore_copy-fix-module-map-when-there-are-no-mod.patch mtd-rawnand-omap_elm-fix-runtime-pm-imbalance-on-err.patch diff --git a/queue-4.19/perf-parse-events-fix-incorrect-conversion-of-if-fre.patch b/queue-4.19/perf-parse-events-fix-incorrect-conversion-of-if-fre.patch deleted file mode 100644 index 28c3f88bfae..00000000000 --- a/queue-4.19/perf-parse-events-fix-incorrect-conversion-of-if-fre.patch +++ /dev/null @@ -1,58 +0,0 @@ -From c9afe7992d1925265f5b454d09df79bfdf2b98b1 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 13 May 2020 10:20:26 -0300 -Subject: perf parse-events: Fix incorrect conversion of 'if () free()' to - 'zfree()' - -From: Arnaldo Carvalho de Melo - -[ Upstream commit 7fcdccd4237724931d9773d1e3039bfe053a6f52 ] - -When applying a patch by Ian I incorrectly converted to zfree() an -expression that involved testing some other struct member, not the one -being freed, which lead to bugs reproduceable by: - - $ perf stat -e i/bs,tsc,L2/o sleep 1 - WARNING: multiple event parsing errors - Segmentation fault (core dumped) - $ - -Fix it by restoring the test for pos->free_str before freeing -pos->val.str, but continue using zfree(&pos->val.str) to set that member -to NULL after freeing it. - -Reported-by: Ian Rogers -Fixes: e8dfb81838b1 ("perf parse-events: Fix memory leaks found on parse_events") -Cc: Adrian Hunter -Cc: Alexander Shishkin -Cc: Andi Kleen -Cc: clang-built-linux@googlegroups.com -Cc: Jiri Olsa -Cc: Leo Yan -Cc: Mark Rutland -Cc: Namhyung Kim -Cc: Peter Zijlstra -Cc: Stephane Eranian -Signed-off-by: Arnaldo Carvalho de Melo -Signed-off-by: Sasha Levin ---- - tools/perf/util/parse-events.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c -index cce96b05d24c9..426f1984c143e 100644 ---- a/tools/perf/util/parse-events.c -+++ b/tools/perf/util/parse-events.c -@@ -1287,7 +1287,8 @@ int parse_events_add_pmu(struct parse_events_state *parse_state, - - list_for_each_entry_safe(pos, tmp, &config_terms, list) { - list_del_init(&pos->list); -- zfree(&pos->val.str); -+ if (pos->free_str) -+ zfree(&pos->val.str); - free(pos); - } - return -EINVAL; --- -2.25.1 - diff --git a/queue-4.19/series b/queue-4.19/series index 9691d2e1564..e5c320c9214 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -176,7 +176,6 @@ printk-handle-blank-console-arguments-passed-in.patch usb-dwc3-increase-timeout-for-cmdact-cleared-by-devi.patch btrfs-don-t-force-read-only-after-error-in-drop-snap.patch vfio-pci-fix-memory-leaks-of-eventfd-ctx.patch -perf-parse-events-fix-incorrect-conversion-of-if-fre.patch perf-evsel-fix-2-memory-leaks.patch perf-trace-fix-the-selection-for-architectures-to-ge.patch perf-stat-fix-duration_time-value-for-higher-interva.patch diff --git a/queue-4.4/serial-uartps-wait-for-tx_empty-in-console-setup.patch b/queue-4.4/serial-uartps-wait-for-tx_empty-in-console-setup.patch deleted file mode 100644 index da66332ed23..00000000000 --- a/queue-4.4/serial-uartps-wait-for-tx_empty-in-console-setup.patch +++ /dev/null @@ -1,54 +0,0 @@ -From fa47da5df18e10b9a3aecee4ca9e3980e53c5ffa Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 9 Apr 2020 11:56:02 +0530 -Subject: serial: uartps: Wait for tx_empty in console setup - -From: Raviteja Narayanam - -[ Upstream commit 42e11948ddf68b9f799cad8c0ddeab0a39da33e8 ] - -On some platforms, the log is corrupted while console is being -registered. It is observed that when set_termios is called, there -are still some bytes in the FIFO to be transmitted. - -So, wait for tx_empty inside cdns_uart_console_setup before calling -set_termios. - -Signed-off-by: Raviteja Narayanam -Reviewed-by: Shubhrajyoti Datta -Link: https://lore.kernel.org/r/1586413563-29125-2-git-send-email-raviteja.narayanam@xilinx.com -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Sasha Levin ---- - drivers/tty/serial/xilinx_uartps.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c -index 06efcef1b4953..5b4469098888a 100644 ---- a/drivers/tty/serial/xilinx_uartps.c -+++ b/drivers/tty/serial/xilinx_uartps.c -@@ -1152,6 +1152,7 @@ static int cdns_uart_console_setup(struct console *co, char *options) - int bits = 8; - int parity = 'n'; - int flow = 'n'; -+ unsigned long time_out; - - if (co->index < 0 || co->index >= CDNS_UART_NR_PORTS) - return -EINVAL; -@@ -1165,6 +1166,13 @@ static int cdns_uart_console_setup(struct console *co, char *options) - if (options) - uart_parse_options(options, &baud, &parity, &bits, &flow); - -+ /* Wait for tx_empty before setting up the console */ -+ time_out = jiffies + usecs_to_jiffies(TX_TIMEOUT); -+ -+ while (time_before(jiffies, time_out) && -+ cdns_uart_tx_empty(port) != TIOCSER_TEMT) -+ cpu_relax(); -+ - return uart_set_options(port, co, baud, parity, bits, flow); - } - --- -2.25.1 - diff --git a/queue-4.4/series b/queue-4.4/series index 688662f4475..f1716e24530 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -48,7 +48,6 @@ ubifs-fix-out-of-bounds-memory-access-caused-by-abno.patch alsa-usb-audio-fix-case-when-usb-midi-interface-has-.patch mm-filemap.c-clear-page-error-before-actual-read.patch mm-mmap.c-initialize-align_offset-explicitly-for-vm_.patch -serial-uartps-wait-for-tx_empty-in-console-setup.patch kvm-remove-create_irqchip-set_pit2-race.patch bdev-reduce-time-holding-bd_mutex-in-sync-in-blkdev_.patch drivers-char-tlclk.c-avoid-data-race-between-init-an.patch diff --git a/queue-5.4/perf-parse-events-fix-incorrect-conversion-of-if-fre.patch b/queue-5.4/perf-parse-events-fix-incorrect-conversion-of-if-fre.patch deleted file mode 100644 index 148df5048d3..00000000000 --- a/queue-5.4/perf-parse-events-fix-incorrect-conversion-of-if-fre.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 8dbb125df1a9a3ef386611634ed3c850771f5e93 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 13 May 2020 10:20:26 -0300 -Subject: perf parse-events: Fix incorrect conversion of 'if () free()' to - 'zfree()' - -From: Arnaldo Carvalho de Melo - -[ Upstream commit 7fcdccd4237724931d9773d1e3039bfe053a6f52 ] - -When applying a patch by Ian I incorrectly converted to zfree() an -expression that involved testing some other struct member, not the one -being freed, which lead to bugs reproduceable by: - - $ perf stat -e i/bs,tsc,L2/o sleep 1 - WARNING: multiple event parsing errors - Segmentation fault (core dumped) - $ - -Fix it by restoring the test for pos->free_str before freeing -pos->val.str, but continue using zfree(&pos->val.str) to set that member -to NULL after freeing it. - -Reported-by: Ian Rogers -Fixes: e8dfb81838b1 ("perf parse-events: Fix memory leaks found on parse_events") -Cc: Adrian Hunter -Cc: Alexander Shishkin -Cc: Andi Kleen -Cc: clang-built-linux@googlegroups.com -Cc: Jiri Olsa -Cc: Leo Yan -Cc: Mark Rutland -Cc: Namhyung Kim -Cc: Peter Zijlstra -Cc: Stephane Eranian -Signed-off-by: Arnaldo Carvalho de Melo -Signed-off-by: Sasha Levin ---- - tools/perf/util/parse-events.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c -index f3b10b8449010..ca9006cd4bf18 100644 ---- a/tools/perf/util/parse-events.c -+++ b/tools/perf/util/parse-events.c -@@ -1370,7 +1370,8 @@ int parse_events_add_pmu(struct parse_events_state *parse_state, - - list_for_each_entry_safe(pos, tmp, &config_terms, list) { - list_del_init(&pos->list); -- zfree(&pos->val.str); -+ if (pos->free_str) -+ zfree(&pos->val.str); - free(pos); - } - return -EINVAL; --- -2.25.1 - diff --git a/queue-5.4/series b/queue-5.4/series index f56ca31ef53..b5f9ad81640 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -281,7 +281,6 @@ btrfs-fix-double-__endio_write_update_ordered-in-dir.patch gpio-rcar-fix-runtime-pm-imbalance-on-error.patch vfio-pci-fix-memory-leaks-of-eventfd-ctx.patch kvm-ppc-book3s-hv-close-race-with-page-faults-around.patch -perf-parse-events-fix-incorrect-conversion-of-if-fre.patch perf-evsel-fix-2-memory-leaks.patch perf-trace-fix-the-selection-for-architectures-to-ge.patch perf-stat-fix-duration_time-value-for-higher-interva.patch