]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Mar 2020 12:20:31 +0000 (14:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Mar 2020 12:20:31 +0000 (14:20 +0200)
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

queue-4.4/mac80211-mark-station-unauthorized-before-key-removal.patch [new file with mode: 0644]
queue-4.4/perf-probe-do-not-depend-on-dwfl_module_addrsym.patch [new file with mode: 0644]
queue-4.4/scripts-dtc-remove-redundant-yyloc-global-declaration.patch [new file with mode: 0644]
queue-4.4/scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch [new file with mode: 0644]
queue-4.4/series

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 (file)
index 0000000..6189c92
--- /dev/null
@@ -0,0 +1,45 @@
+From b16798f5b907733966fd1a558fca823b3c67e4a1 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Thu, 26 Mar 2020 15:51:35 +0100
+Subject: mac80211: mark station unauthorized before key removal
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+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 <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 <jbenc@suse.cz>
+  * 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 (file)
index 0000000..b4e6895
--- /dev/null
@@ -0,0 +1,63 @@
+From 1efde2754275dbd9d11c6e0132a4f09facf297ab Mon Sep 17 00:00:00 2001
+From: Masami Hiramatsu <mhiramat@kernel.org>
+Date: Fri, 28 Feb 2020 00:42:01 +0900
+Subject: perf probe: Do not depend on dwfl_module_addrsym()
+
+From: Masami Hiramatsu <mhiramat@kernel.org>
+
+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 <alex@ghiti.fr>
+Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
+Tested-by: Alexandre Ghiti <alex@ghiti.fr>
+Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Jiri Olsa <jolsa@redhat.com>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Sasha Levin <sashal@kernel.org>
+Link: http://lore.kernel.org/lkml/158281812176.476.14164573830975116234.stgit@devnote2
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..55dbb87
--- /dev/null
@@ -0,0 +1,52 @@
+From e33a814e772cdc36436c8c188d8c42d019fda639 Mon Sep 17 00:00:00 2001
+From: Dirk Mueller <dmueller@suse.com>
+Date: Tue, 14 Jan 2020 18:53:41 +0100
+Subject: scripts/dtc: Remove redundant YYLOC global declaration
+
+From: Dirk Mueller <dmueller@suse.com>
+
+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 <dmueller@suse.com>
+Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+[robh: cherry-pick from upstream]
+Cc: stable@vger.kernel.org
+Signed-off-by: Rob Herring <robh@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..c7570b5
--- /dev/null
@@ -0,0 +1,54 @@
+From ea697a8bf5a4161e59806fab14f6e4a46dc7dcb0 Mon Sep 17 00:00:00 2001
+From: "Martin K. Petersen" <martin.petersen@oracle.com>
+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 <martin.petersen@oracle.com>
+
+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 <bgurney@redhat.com>
+Cc: <stable@vger.kernel.org>
+Reported-by: Bernhard Sulzer <micraft.b@gmail.com>
+Tested-by: Bernhard Sulzer <micraft.b@gmail.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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));
index dbdd90d6c8946d8448405e64029a9b656ea50db8..0d28152587bc19e0fa17c5c2395d55e730fec07f 100644 (file)
@@ -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