]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 Sep 2023 13:29:24 +0000 (15:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 Sep 2023 13:29:24 +0000 (15:29 +0200)
added patches:
bluetooth-btsdio-fix-use-after-free-bug-in-btsdio_remove-due-to-race-condition.patch
wifi-mt76-mt7921-do-not-support-one-stream-on-secondary-antenna-only.patch

queue-5.15/bluetooth-btsdio-fix-use-after-free-bug-in-btsdio_remove-due-to-race-condition.patch [new file with mode: 0644]
queue-5.15/series
queue-5.15/wifi-mt76-mt7921-do-not-support-one-stream-on-secondary-antenna-only.patch [new file with mode: 0644]

diff --git a/queue-5.15/bluetooth-btsdio-fix-use-after-free-bug-in-btsdio_remove-due-to-race-condition.patch b/queue-5.15/bluetooth-btsdio-fix-use-after-free-bug-in-btsdio_remove-due-to-race-condition.patch
new file mode 100644 (file)
index 0000000..310c8db
--- /dev/null
@@ -0,0 +1,38 @@
+From 73f7b171b7c09139eb3c6a5677c200dc1be5f318 Mon Sep 17 00:00:00 2001
+From: Zheng Wang <zyytlz.wz@163.com>
+Date: Thu, 9 Mar 2023 00:45:01 +0800
+Subject: Bluetooth: btsdio: fix use after free bug in btsdio_remove due to race condition
+
+From: Zheng Wang <zyytlz.wz@163.com>
+
+commit 73f7b171b7c09139eb3c6a5677c200dc1be5f318 upstream.
+
+In btsdio_probe, the data->work is bound with btsdio_work. It will be
+started in btsdio_send_frame.
+
+If the btsdio_remove runs with a unfinished work, there may be a race
+condition that hdev is freed but used in btsdio_work. Fix it by
+canceling the work before do cleanup in btsdio_remove.
+
+Fixes: CVE-2023-1989
+Fixes: ddbaf13e3609 ("[Bluetooth] Add generic driver for Bluetooth SDIO devices")
+Cc: stable@vger.kernel.org
+Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
+Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+[ Denis: Added CVE-2023-1989 and fixes tags. ]
+Signed-off-by: Denis Efremov (Oracle) <efremov@linux.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/bluetooth/btsdio.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/bluetooth/btsdio.c
++++ b/drivers/bluetooth/btsdio.c
+@@ -355,6 +355,7 @@ static void btsdio_remove(struct sdio_fu
+       if (!data)
+               return;
++      cancel_work_sync(&data->work);
+       hdev = data->hdev;
+       sdio_set_drvdata(func, NULL);
index 91fbbc9ef1ba49340a4193ae88c9b4720648e3da..ff91b700dd490db4fa1a4510a23c2d8c71d5c2dc 100644 (file)
@@ -13,3 +13,5 @@ usb-dwc3-meson-g12a-do-post-init-to-fix-broken-usb-after-resumption.patch
 usb-chipidea-imx-improve-logic-if-samsung-picophy-parameter-is-0.patch
 hid-wacom-remove-the-battery-when-the-ekr-is-off.patch
 staging-rtl8712-fix-race-condition.patch
+bluetooth-btsdio-fix-use-after-free-bug-in-btsdio_remove-due-to-race-condition.patch
+wifi-mt76-mt7921-do-not-support-one-stream-on-secondary-antenna-only.patch
diff --git a/queue-5.15/wifi-mt76-mt7921-do-not-support-one-stream-on-secondary-antenna-only.patch b/queue-5.15/wifi-mt76-mt7921-do-not-support-one-stream-on-secondary-antenna-only.patch
new file mode 100644 (file)
index 0000000..097d528
--- /dev/null
@@ -0,0 +1,42 @@
+From d616d3680264beb9a9d2c4fc681064b06f447eeb Mon Sep 17 00:00:00 2001
+From: Deren Wu <deren.wu@mediatek.com>
+Date: Wed, 10 May 2023 14:51:13 +0800
+Subject: wifi: mt76: mt7921: do not support one stream on secondary antenna only
+
+From: Deren Wu <deren.wu@mediatek.com>
+
+commit d616d3680264beb9a9d2c4fc681064b06f447eeb upstream.
+
+mt7921 support following antenna combiantions only.
+* primary + secondary (2x2)
+* primary only        (1x1)
+
+Since we cannot work on secondary antenna only, return error if the
+antenna bitmap is 0x2 in .set_antenna().
+
+For example:
+iw phy0 set antenna 3 3 /* valid */
+iw phy0 set antenna 1 1 /* valid */
+iw phy0 set antenna 2 2 /* invalid */
+
+Cc: stable@vger.kernel.org
+Fixes: e0f9fdda81bd ("mt76: mt7921: add ieee80211_ops")
+Suggested-by: Knox Chiou <knoxchiou@google.com>
+Signed-off-by: Deren Wu <deren.wu@mediatek.com>
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/wireless/mediatek/mt76/mt7921/main.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
++++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+@@ -994,7 +994,7 @@ mt7921_set_antenna(struct ieee80211_hw *
+               return -EINVAL;
+       if ((BIT(hweight8(tx_ant)) - 1) != tx_ant)
+-              tx_ant = BIT(ffs(tx_ant) - 1) - 1;
++              return -EINVAL;
+       mt7921_mutex_acquire(dev);