]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 2 May 2021 11:35:25 +0000 (13:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 2 May 2021 11:35:25 +0000 (13:35 +0200)
added patches:
net-usb-ax88179_178a-initialize-local-variables-before-use.patch

queue-5.10/net-usb-ax88179_178a-initialize-local-variables-before-use.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/net-usb-ax88179_178a-initialize-local-variables-before-use.patch b/queue-5.10/net-usb-ax88179_178a-initialize-local-variables-before-use.patch
new file mode 100644 (file)
index 0000000..30b1a4c
--- /dev/null
@@ -0,0 +1,48 @@
+From bd78980be1a68d14524c51c4b4170782fada622b Mon Sep 17 00:00:00 2001
+From: Phillip Potter <phil@philpotter.co.uk>
+Date: Thu, 1 Apr 2021 23:36:07 +0100
+Subject: net: usb: ax88179_178a: initialize local variables before use
+
+From: Phillip Potter <phil@philpotter.co.uk>
+
+commit bd78980be1a68d14524c51c4b4170782fada622b upstream.
+
+Use memset to initialize local array in drivers/net/usb/ax88179_178a.c, and
+also set a local u16 and u32 variable to 0. Fixes a KMSAN found uninit-value bug
+reported by syzbot at:
+https://syzkaller.appspot.com/bug?id=00371c73c72f72487c1d0bfe0cc9d00de339d5aa
+
+Reported-by: syzbot+4993e4a0e237f1b53747@syzkaller.appspotmail.com
+Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/usb/ax88179_178a.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/usb/ax88179_178a.c
++++ b/drivers/net/usb/ax88179_178a.c
+@@ -296,12 +296,12 @@ static int ax88179_read_cmd(struct usbne
+       int ret;
+       if (2 == size) {
+-              u16 buf;
++              u16 buf = 0;
+               ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
+               le16_to_cpus(&buf);
+               *((u16 *)data) = buf;
+       } else if (4 == size) {
+-              u32 buf;
++              u32 buf = 0;
+               ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
+               le32_to_cpus(&buf);
+               *((u32 *)data) = buf;
+@@ -1296,6 +1296,8 @@ static void ax88179_get_mac_addr(struct
+ {
+       u8 mac[ETH_ALEN];
++      memset(mac, 0, sizeof(mac));
++
+       /* Maybe the boot loader passed the MAC address via device tree */
+       if (!eth_platform_get_mac_address(&dev->udev->dev, mac)) {
+               netif_dbg(dev, ifup, dev->net,
index 8112b37f82c21dee9a0096de5596ee337f0f0ae8..2be292fc38318ab598b090a39825c40688035946 100644 (file)
@@ -1,2 +1,3 @@
 mips-do-not-include-hi-and-lo-in-clobber-list-for-r6.patch
 netfilter-conntrack-make-global-sysctls-readonly-in-non-init-netns.patch
+net-usb-ax88179_178a-initialize-local-variables-before-use.patch