From: Greg Kroah-Hartman Date: Mon, 30 Mar 2020 12:20:31 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v5.6.1~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=168c29559343378ac9a71b204f2f21608b4ac5bd;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: mac80211-mark-station-unauthorized-before-key-removal.patch perf-probe-do-not-depend-on-dwfl_module_addrsym.patch scripts-dtc-remove-redundant-yyloc-global-declaration.patch scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch --- diff --git a/queue-4.4/mac80211-mark-station-unauthorized-before-key-removal.patch b/queue-4.4/mac80211-mark-station-unauthorized-before-key-removal.patch new file mode 100644 index 00000000000..6189c920129 --- /dev/null +++ b/queue-4.4/mac80211-mark-station-unauthorized-before-key-removal.patch @@ -0,0 +1,45 @@ +From b16798f5b907733966fd1a558fca823b3c67e4a1 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Thu, 26 Mar 2020 15:51:35 +0100 +Subject: mac80211: mark station unauthorized before key removal + +From: Johannes Berg + +commit b16798f5b907733966fd1a558fca823b3c67e4a1 upstream. + +If a station is still marked as authorized, mark it as no longer +so before removing its keys. This allows frames transmitted to it +to be rejected, providing additional protection against leaking +plain text data during the disconnection flow. + +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20200326155133.ccb4fb0bb356.If48f0f0504efdcf16b8921f48c6d3bb2cb763c99@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/mac80211/sta_info.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -2,6 +2,7 @@ + * Copyright 2002-2005, Instant802 Networks, Inc. + * Copyright 2006-2007 Jiri Benc + * Copyright 2013-2014 Intel Mobile Communications GmbH ++ * Copyright (C) 2018-2020 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as +@@ -904,6 +905,11 @@ static void __sta_info_destroy_part2(str + might_sleep(); + lockdep_assert_held(&local->sta_mtx); + ++ while (sta->sta_state == IEEE80211_STA_AUTHORIZED) { ++ ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC); ++ WARN_ON_ONCE(ret); ++ } ++ + /* now keys can no longer be reached */ + ieee80211_free_sta_keys(local, sta); + diff --git a/queue-4.4/perf-probe-do-not-depend-on-dwfl_module_addrsym.patch b/queue-4.4/perf-probe-do-not-depend-on-dwfl_module_addrsym.patch new file mode 100644 index 00000000000..b4e6895c02f --- /dev/null +++ b/queue-4.4/perf-probe-do-not-depend-on-dwfl_module_addrsym.patch @@ -0,0 +1,63 @@ +From 1efde2754275dbd9d11c6e0132a4f09facf297ab Mon Sep 17 00:00:00 2001 +From: Masami Hiramatsu +Date: Fri, 28 Feb 2020 00:42:01 +0900 +Subject: perf probe: Do not depend on dwfl_module_addrsym() + +From: Masami Hiramatsu + +commit 1efde2754275dbd9d11c6e0132a4f09facf297ab upstream. + +Do not depend on dwfl_module_addrsym() because it can fail on user-space +shared libraries. + +Actually, same bug was fixed by commit 664fee3dc379 ("perf probe: Do not +use dwfl_module_addrsym if dwarf_diename finds symbol name"), but commit +07d369857808 ("perf probe: Fix wrong address verification) reverted to +get actual symbol address from symtab. + +This fixes it again by getting symbol address from DIE, and only if the +DIE has only address range, it uses dwfl_module_addrsym(). + +Fixes: 07d369857808 ("perf probe: Fix wrong address verification) +Reported-by: Alexandre Ghiti +Signed-off-by: Masami Hiramatsu +Tested-by: Alexandre Ghiti +Cc: Alexander Shishkin +Cc: Greg Kroah-Hartman +Cc: Jiri Olsa +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Sasha Levin +Link: http://lore.kernel.org/lkml/158281812176.476.14164573830975116234.stgit@devnote2 +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/probe-finder.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +--- a/tools/perf/util/probe-finder.c ++++ b/tools/perf/util/probe-finder.c +@@ -608,14 +608,19 @@ static int convert_to_trace_point(Dwarf_ + return -EINVAL; + } + +- /* Try to get actual symbol name from symtab */ +- symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL); ++ if (dwarf_entrypc(sp_die, &eaddr) == 0) { ++ /* If the DIE has entrypc, use it. */ ++ symbol = dwarf_diename(sp_die); ++ } else { ++ /* Try to get actual symbol name and address from symtab */ ++ symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL); ++ eaddr = sym.st_value; ++ } + if (!symbol) { + pr_warning("Failed to find symbol at 0x%lx\n", + (unsigned long)paddr); + return -ENOENT; + } +- eaddr = sym.st_value; + + tp->offset = (unsigned long)(paddr - eaddr); + tp->address = (unsigned long)paddr; diff --git a/queue-4.4/scripts-dtc-remove-redundant-yyloc-global-declaration.patch b/queue-4.4/scripts-dtc-remove-redundant-yyloc-global-declaration.patch new file mode 100644 index 00000000000..55dbb87370e --- /dev/null +++ b/queue-4.4/scripts-dtc-remove-redundant-yyloc-global-declaration.patch @@ -0,0 +1,52 @@ +From e33a814e772cdc36436c8c188d8c42d019fda639 Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +Date: Tue, 14 Jan 2020 18:53:41 +0100 +Subject: scripts/dtc: Remove redundant YYLOC global declaration + +From: Dirk Mueller + +commit e33a814e772cdc36436c8c188d8c42d019fda639 upstream. + +gcc 10 will default to -fno-common, which causes this error at link +time: + + (.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here + +This is because both dtc-lexer as well as dtc-parser define the same +global symbol yyloc. Before with -fcommon those were merged into one +defintion. The proper solution would be to to mark this as "extern", +however that leads to: + + dtc-lexer.l:26:16: error: redundant redeclaration of 'yylloc' [-Werror=redundant-decls] + 26 | extern YYLTYPE yylloc; + | ^~~~~~ +In file included from dtc-lexer.l:24: +dtc-parser.tab.h:127:16: note: previous declaration of 'yylloc' was here + 127 | extern YYLTYPE yylloc; + | ^~~~~~ +cc1: all warnings being treated as errors + +which means the declaration is completely redundant and can just be +dropped. + +Signed-off-by: Dirk Mueller +Signed-off-by: David Gibson +[robh: cherry-pick from upstream] +Cc: stable@vger.kernel.org +Signed-off-by: Rob Herring +Signed-off-by: Greg Kroah-Hartman + +--- + scripts/dtc/dtc-lexer.l | 1 - + 1 file changed, 1 deletion(-) + +--- a/scripts/dtc/dtc-lexer.l ++++ b/scripts/dtc/dtc-lexer.l +@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n + #include "srcpos.h" + #include "dtc-parser.tab.h" + +-YYLTYPE yylloc; + extern bool treesource_error; + + /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ diff --git a/queue-4.4/scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch b/queue-4.4/scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch new file mode 100644 index 00000000000..c7570b5b054 --- /dev/null +++ b/queue-4.4/scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch @@ -0,0 +1,54 @@ +From ea697a8bf5a4161e59806fab14f6e4a46dc7dcb0 Mon Sep 17 00:00:00 2001 +From: "Martin K. Petersen" +Date: Tue, 24 Mar 2020 11:16:15 -0400 +Subject: scsi: sd: Fix optimal I/O size for devices that change reported values + +From: Martin K. Petersen + +commit ea697a8bf5a4161e59806fab14f6e4a46dc7dcb0 upstream. + +Some USB bridge devices will return a default set of characteristics during +initialization. And then, once an attached drive has spun up, substitute +the actual parameters reported by the drive. According to the SCSI spec, +the device should return a UNIT ATTENTION in case any reported parameters +change. But in this case the change is made silently after a small window +where default values are reported. + +Commit a83da8a4509d ("scsi: sd: Optimal I/O size should be a multiple of +physical block size") validated the reported optimal I/O size against the +physical block size to overcome problems with devices reporting nonsensical +transfer sizes. However, this validation did not account for the fact that +aforementioned devices will return default values during a brief window +during spin-up. The subsequent change in reported characteristics would +invalidate the checking that had previously been performed. + +Unset a previously configured optimal I/O size should the sanity checking +fail on subsequent revalidate attempts. + +Link: https://lore.kernel.org/r/33fb522e-4f61-1b76-914f-c9e6a3553c9b@gmail.com +Cc: Bryan Gurney +Cc: +Reported-by: Bernhard Sulzer +Tested-by: Bernhard Sulzer +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/sd.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -2915,9 +2915,11 @@ static int sd_revalidate_disk(struct gen + logical_to_bytes(sdp, sdkp->opt_xfer_blocks) >= PAGE_CACHE_SIZE) { + q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks); + rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks); +- } else ++ } else { ++ q->limits.io_opt = 0; + rw_max = min_not_zero(logical_to_sectors(sdp, dev_max), + (sector_t)BLK_DEF_MAX_SECTORS); ++ } + + /* Do not exceed controller limit */ + rw_max = min(rw_max, queue_max_hw_sectors(q)); diff --git a/queue-4.4/series b/queue-4.4/series index dbdd90d6c89..0d28152587b 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -53,3 +53,7 @@ scsi-ipr-fix-softlockup-when-rescanning-devices-in-p.patch mac80211-do-not-send-mesh-hwmp-preq-if-hwmp-is-disab.patch sxgbe-fix-off-by-one-in-samsung-driver-strncpy-size-.patch i2c-hix5hd2-add-missed-clk_disable_unprepare-in-remove.patch +perf-probe-do-not-depend-on-dwfl_module_addrsym.patch +scripts-dtc-remove-redundant-yyloc-global-declaration.patch +scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch +mac80211-mark-station-unauthorized-before-key-removal.patch