]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Oct 2019 17:38:29 +0000 (19:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Oct 2019 17:38:29 +0000 (19:38 +0200)
added patches:
cfg80211-initialize-on-stack-chandefs.patch
ieee802154-atusb-fix-use-after-free-at-disconnect.patch
mmc-sdhci-of-esdhc-set-dma-snooping-based-on-dma-coherence.patch

queue-4.4/cfg80211-initialize-on-stack-chandefs.patch [new file with mode: 0644]
queue-4.4/ieee802154-atusb-fix-use-after-free-at-disconnect.patch [new file with mode: 0644]
queue-4.4/mmc-sdhci-of-esdhc-set-dma-snooping-based-on-dma-coherence.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/cfg80211-initialize-on-stack-chandefs.patch b/queue-4.4/cfg80211-initialize-on-stack-chandefs.patch
new file mode 100644 (file)
index 0000000..097fc18
--- /dev/null
@@ -0,0 +1,72 @@
+From f43e5210c739fe76a4b0ed851559d6902f20ceb1 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Mon, 23 Sep 2019 13:51:16 +0200
+Subject: cfg80211: initialize on-stack chandefs
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+commit f43e5210c739fe76a4b0ed851559d6902f20ceb1 upstream.
+
+In a few places we don't properly initialize on-stack chandefs,
+resulting in EDMG data to be non-zero, which broke things.
+
+Additionally, in a few places we rely on the driver to init the
+data completely, but perhaps we shouldn't as non-EDMG drivers
+may not initialize the EDMG data, also initialize it there.
+
+Cc: stable@vger.kernel.org
+Fixes: 2a38075cd0be ("nl80211: Add support for EDMG channels")
+Reported-by: Dmitry Osipenko <digetx@gmail.com>
+Tested-by: Dmitry Osipenko <digetx@gmail.com>
+Link: https://lore.kernel.org/r/1569239475-I2dcce394ecf873376c386a78f31c2ec8b538fa25@changeid
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/wireless/nl80211.c     |    4 +++-
+ net/wireless/reg.c         |    2 +-
+ net/wireless/wext-compat.c |    2 +-
+ 3 files changed, 5 insertions(+), 3 deletions(-)
+
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -1934,6 +1934,8 @@ static int nl80211_parse_chandef(struct
+       control_freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]);
++      memset(chandef, 0, sizeof(*chandef));
++
+       chandef->chan = ieee80211_get_channel(&rdev->wiphy, control_freq);
+       chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
+       chandef->center_freq1 = control_freq;
+@@ -2402,7 +2404,7 @@ static int nl80211_send_iface(struct sk_
+       if (rdev->ops->get_channel) {
+               int ret;
+-              struct cfg80211_chan_def chandef;
++              struct cfg80211_chan_def chandef = {};
+               ret = rdev_get_channel(rdev, wdev, &chandef);
+               if (ret == 0) {
+--- a/net/wireless/reg.c
++++ b/net/wireless/reg.c
+@@ -1604,7 +1604,7 @@ static void reg_call_notifier(struct wip
+ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev)
+ {
+-      struct cfg80211_chan_def chandef;
++      struct cfg80211_chan_def chandef = {};
+       struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
+       enum nl80211_iftype iftype;
+--- a/net/wireless/wext-compat.c
++++ b/net/wireless/wext-compat.c
+@@ -821,7 +821,7 @@ static int cfg80211_wext_giwfreq(struct
+ {
+       struct wireless_dev *wdev = dev->ieee80211_ptr;
+       struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
+-      struct cfg80211_chan_def chandef;
++      struct cfg80211_chan_def chandef = {};
+       int ret;
+       switch (wdev->iftype) {
diff --git a/queue-4.4/ieee802154-atusb-fix-use-after-free-at-disconnect.patch b/queue-4.4/ieee802154-atusb-fix-use-after-free-at-disconnect.patch
new file mode 100644 (file)
index 0000000..1e2d288
--- /dev/null
@@ -0,0 +1,39 @@
+From 7fd25e6fc035f4b04b75bca6d7e8daa069603a76 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Thu, 19 Sep 2019 14:12:34 +0200
+Subject: ieee802154: atusb: fix use-after-free at disconnect
+
+From: Johan Hovold <johan@kernel.org>
+
+commit 7fd25e6fc035f4b04b75bca6d7e8daa069603a76 upstream.
+
+The disconnect callback was accessing the hardware-descriptor private
+data after having having freed it.
+
+Fixes: 7490b008d123 ("ieee802154: add support for atusb transceiver")
+Cc: stable <stable@vger.kernel.org>     # 4.2
+Cc: Alexander Aring <alex.aring@gmail.com>
+Reported-by: syzbot+f4509a9138a1472e7e80@syzkaller.appspotmail.com
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ieee802154/atusb.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ieee802154/atusb.c
++++ b/drivers/net/ieee802154/atusb.c
+@@ -756,10 +756,11 @@ static void atusb_disconnect(struct usb_
+       ieee802154_unregister_hw(atusb->hw);
++      usb_put_dev(atusb->usb_dev);
++
+       ieee802154_free_hw(atusb->hw);
+       usb_set_intfdata(interface, NULL);
+-      usb_put_dev(atusb->usb_dev);
+       pr_debug("atusb_disconnect done\n");
+ }
diff --git a/queue-4.4/mmc-sdhci-of-esdhc-set-dma-snooping-based-on-dma-coherence.patch b/queue-4.4/mmc-sdhci-of-esdhc-set-dma-snooping-based-on-dma-coherence.patch
new file mode 100644 (file)
index 0000000..2673b3d
--- /dev/null
@@ -0,0 +1,74 @@
+From 121bd08b029e03404c451bb237729cdff76eafed Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel@armlinux.org.uk>
+Date: Sun, 22 Sep 2019 11:26:58 +0100
+Subject: mmc: sdhci-of-esdhc: set DMA snooping based on DMA coherence
+
+From: Russell King <rmk+kernel@armlinux.org.uk>
+
+commit 121bd08b029e03404c451bb237729cdff76eafed upstream.
+
+We must not unconditionally set the DMA snoop bit; if the DMA API is
+assuming that the device is not DMA coherent, and the device snoops the
+CPU caches, the device can see stale cache lines brought in by
+speculative prefetch.
+
+This leads to the device seeing stale data, potentially resulting in
+corrupted data transfers.  Commonly, this results in a descriptor fetch
+error such as:
+
+mmc0: ADMA error
+mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
+mmc0: sdhci: Sys addr:  0x00000000 | Version:  0x00002202
+mmc0: sdhci: Blk size:  0x00000008 | Blk cnt:  0x00000001
+mmc0: sdhci: Argument:  0x00000000 | Trn mode: 0x00000013
+mmc0: sdhci: Present:   0x01f50008 | Host ctl: 0x00000038
+mmc0: sdhci: Power:     0x00000003 | Blk gap:  0x00000000
+mmc0: sdhci: Wake-up:   0x00000000 | Clock:    0x000040d8
+mmc0: sdhci: Timeout:   0x00000003 | Int stat: 0x00000001
+mmc0: sdhci: Int enab:  0x037f108f | Sig enab: 0x037f108b
+mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00002202
+mmc0: sdhci: Caps:      0x35fa0000 | Caps_1:   0x0000af00
+mmc0: sdhci: Cmd:       0x0000333a | Max curr: 0x00000000
+mmc0: sdhci: Resp[0]:   0x00000920 | Resp[1]:  0x001d8a33
+mmc0: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x3f400e00
+mmc0: sdhci: Host ctl2: 0x00000000
+mmc0: sdhci: ADMA Err:  0x00000009 | ADMA Ptr: 0x000000236d43820c
+mmc0: sdhci: ============================================
+mmc0: error -5 whilst initialising SD card
+
+but can lead to other errors, and potentially direct the SDHCI
+controller to read/write data to other memory locations (e.g. if a valid
+descriptor is visible to the device in a stale cache line.)
+
+Fix this by ensuring that the DMA snoop bit corresponds with the
+behaviour of the DMA API.  Since the driver currently only supports DT,
+use of_dma_is_coherent().  Note that device_get_dma_attr() can not be
+used as that risks re-introducing this bug if/when the driver is
+converted to ACPI.
+
+Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/sdhci-of-esdhc.c |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/sdhci-of-esdhc.c
++++ b/drivers/mmc/host/sdhci-of-esdhc.c
+@@ -382,7 +382,12 @@ static int esdhc_of_enable_dma(struct sd
+       u32 value;
+       value = sdhci_readl(host, ESDHC_DMA_SYSCTL);
+-      value |= ESDHC_DMA_SNOOP;
++
++      if (of_dma_is_coherent(dev->of_node))
++              value |= ESDHC_DMA_SNOOP;
++      else
++              value &= ~ESDHC_DMA_SNOOP;
++
+       sdhci_writel(host, value, ESDHC_DMA_SYSCTL);
+       return 0;
+ }
index 809bb99a612b8283b7c1250d96ac69b462f7b618..c20363ec817d320c3298183ca8d0e65e633d16d0 100644 (file)
@@ -7,3 +7,6 @@ asoc-define-a-set-of-dapm-pre-post-up-events.patch
 powerpc-powernv-restrict-opal-symbol-map-to-only-be-readable-by-root.patch
 can-mcp251x-mcp251x_hw_reset-allow-more-time-after-a-reset.patch
 crypto-qat-silence-smp_processor_id-warning.patch
+mmc-sdhci-of-esdhc-set-dma-snooping-based-on-dma-coherence.patch
+ieee802154-atusb-fix-use-after-free-at-disconnect.patch
+cfg80211-initialize-on-stack-chandefs.patch