All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Phong Tran <tranmanphong@gmail.com>,
	syzbot+8a3fc6674bbc3978ed4e@syzkaller.appspotmail.com,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	clang-built-linux@googlegroups.com
Subject: [PATCH AUTOSEL 4.9 66/73] net: usb: asix: init MAC address buffers
Date: Mon, 15 Jul 2019 10:36:22 -0400	[thread overview]
Message-ID: <20190715143629.10893-66-sashal@kernel.org> (raw)
In-Reply-To: <20190715143629.10893-1-sashal@kernel.org>

From: Phong Tran <tranmanphong@gmail.com>

[ Upstream commit 78226f6eaac80bf30256a33a4926c194ceefdf36 ]

This is for fixing bug KMSAN: uninit-value in ax88772_bind

Tested by
https://groups.google.com/d/msg/syzkaller-bugs/aFQurGotng4/eB_HlNhhCwAJ

Reported-by: syzbot+8a3fc6674bbc3978ed4e@syzkaller.appspotmail.com

syzbot found the following crash on:

HEAD commit:    f75e4cfe kmsan: use kmsan_handle_urb() in urb.c
git tree:       kmsan
console output: https://syzkaller.appspot.com/x/log.txt?x=136d720ea00000
kernel config:
https://syzkaller.appspot.com/x/.config?x=602468164ccdc30a
dashboard link:
https://syzkaller.appspot.com/bug?extid=8a3fc6674bbc3978ed4e
compiler:       clang version 9.0.0 (/home/glider/llvm/clang
06d00afa61eef8f7f501ebdb4e8612ea43ec2d78)
syz repro:
https://syzkaller.appspot.com/x/repro.syz?x=12788316a00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=120359aaa00000

==================================================================
BUG: KMSAN: uninit-value in is_valid_ether_addr
include/linux/etherdevice.h:200 [inline]
BUG: KMSAN: uninit-value in asix_set_netdev_dev_addr
drivers/net/usb/asix_devices.c:73 [inline]
BUG: KMSAN: uninit-value in ax88772_bind+0x93d/0x11e0
drivers/net/usb/asix_devices.c:724
CPU: 0 PID: 3348 Comm: kworker/0:2 Not tainted 5.1.0+ #1
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Workqueue: usb_hub_wq hub_event
Call Trace:
  __dump_stack lib/dump_stack.c:77 [inline]
  dump_stack+0x191/0x1f0 lib/dump_stack.c:113
  kmsan_report+0x130/0x2a0 mm/kmsan/kmsan.c:622
  __msan_warning+0x75/0xe0 mm/kmsan/kmsan_instr.c:310
  is_valid_ether_addr include/linux/etherdevice.h:200 [inline]
  asix_set_netdev_dev_addr drivers/net/usb/asix_devices.c:73 [inline]
  ax88772_bind+0x93d/0x11e0 drivers/net/usb/asix_devices.c:724
  usbnet_probe+0x10f5/0x3940 drivers/net/usb/usbnet.c:1728
  usb_probe_interface+0xd66/0x1320 drivers/usb/core/driver.c:361
  really_probe+0xdae/0x1d80 drivers/base/dd.c:513
  driver_probe_device+0x1b3/0x4f0 drivers/base/dd.c:671
  __device_attach_driver+0x5b8/0x790 drivers/base/dd.c:778
  bus_for_each_drv+0x28e/0x3b0 drivers/base/bus.c:454
  __device_attach+0x454/0x730 drivers/base/dd.c:844
  device_initial_probe+0x4a/0x60 drivers/base/dd.c:891
  bus_probe_device+0x137/0x390 drivers/base/bus.c:514
  device_add+0x288d/0x30e0 drivers/base/core.c:2106
  usb_set_configuration+0x30dc/0x3750 drivers/usb/core/message.c:2027
  generic_probe+0xe7/0x280 drivers/usb/core/generic.c:210
  usb_probe_device+0x14c/0x200 drivers/usb/core/driver.c:266
  really_probe+0xdae/0x1d80 drivers/base/dd.c:513
  driver_probe_device+0x1b3/0x4f0 drivers/base/dd.c:671
  __device_attach_driver+0x5b8/0x790 drivers/base/dd.c:778
  bus_for_each_drv+0x28e/0x3b0 drivers/base/bus.c:454
  __device_attach+0x454/0x730 drivers/base/dd.c:844
  device_initial_probe+0x4a/0x60 drivers/base/dd.c:891
  bus_probe_device+0x137/0x390 drivers/base/bus.c:514
  device_add+0x288d/0x30e0 drivers/base/core.c:2106
  usb_new_device+0x23e5/0x2ff0 drivers/usb/core/hub.c:2534
  hub_port_connect drivers/usb/core/hub.c:5089 [inline]
  hub_port_connect_change drivers/usb/core/hub.c:5204 [inline]
  port_event drivers/usb/core/hub.c:5350 [inline]
  hub_event+0x48d1/0x7290 drivers/usb/core/hub.c:5432
  process_one_work+0x1572/0x1f00 kernel/workqueue.c:2269
  process_scheduled_works kernel/workqueue.c:2331 [inline]
  worker_thread+0x189c/0x2460 kernel/workqueue.c:2417
  kthread+0x4b5/0x4f0 kernel/kthread.c:254
  ret_from_fork+0x35/0x40 arch/x86/entry/entry_64.S:355

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/usb/asix_devices.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index 393fd3ed6b94..4b12b6da3fab 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -237,7 +237,7 @@ static void asix_phy_reset(struct usbnet *dev, unsigned int reset_bits)
 static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
 {
 	int ret = 0;
-	u8 buf[ETH_ALEN];
+	u8 buf[ETH_ALEN] = {0};
 	int i;
 	unsigned long gpio_bits = dev->driver_info->data;
 
@@ -687,7 +687,7 @@ static int asix_resume(struct usb_interface *intf)
 static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
 {
 	int ret, i;
-	u8 buf[ETH_ALEN], chipcode = 0;
+	u8 buf[ETH_ALEN] = {0}, chipcode = 0;
 	u32 phyid;
 	struct asix_common_private *priv;
 
@@ -1064,7 +1064,7 @@ static const struct net_device_ops ax88178_netdev_ops = {
 static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
 {
 	int ret;
-	u8 buf[ETH_ALEN];
+	u8 buf[ETH_ALEN] = {0};
 
 	usbnet_get_endpoints(dev,intf);
 
-- 
2.20.1


  parent reply	other threads:[~2019-07-15 14:41 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 14:35 [PATCH AUTOSEL 4.9 01/73] ath10k: Do not send probe response template for mesh Sasha Levin
2019-07-15 14:35 ` Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 02/73] ath9k: Check for errors when reading SREV register Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 03/73] ath6kl: add some bounds checking Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 04/73] ath: DFS JP domain W56 fixed pulse type 3 RADAR detection Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 05/73] batman-adv: fix for leaked TVLV handler Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 06/73] media: dvb: usb: fix use after free in dvb_usb_device_exit Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 07/73] crypto: talitos - fix skcipher failure due to wrong output IV Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 08/73] media: marvell-ccic: fix DMA s/g desc number calculation Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 09/73] media: vpss: fix a potential NULL pointer dereference Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 10/73] media: media_device_enum_links32: clean a reserved field Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 11/73] net: stmmac: dwmac1000: Clear unused address entries Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 12/73] net: stmmac: dwmac4/5: " Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 13/73] signal/pid_namespace: Fix reboot_pid_ns to use send_sig not force_sig Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 14/73] signal/cifs: Fix cifs_put_tcp_session to call send_sig instead of force_sig Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 15/73] af_key: fix leaks in key_pol_get_resp and dump_sp Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 16/73] xfrm: Fix xfrm sel prefix length validation Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 17/73] Revert "e1000e: fix cyclic resets at link up with active tx" Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 18/73] e1000e: start network tx queue only when link is up Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 19/73] media: mc-device.c: don't memset __user pointer contents Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 20/73] media: staging: media: davinci_vpfe: - Fix for memory leak if decoder initialization fails Sasha Levin
2019-07-15 14:35   ` Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 21/73] net: phy: Check against net_device being NULL Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 22/73] crypto: talitos - properly handle split ICV Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 23/73] crypto: talitos - Align SEC1 accesses to 32 bits boundaries Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 24/73] tua6100: Avoid build warnings Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 25/73] locking/lockdep: Fix merging of hlocks with non-zero references Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 26/73] media: wl128x: Fix some error handling in fm_v4l2_init_video_device() Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 27/73] cpupower : frequency-set -r option misses the last cpu in related cpu list Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 28/73] net: fec: Do not use netdev messages too early Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 29/73] net: axienet: Fix race condition causing TX hang Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 30/73] s390/qdio: handle PENDING state for QEBSM devices Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 31/73] perf cs-etm: Properly set the value of 'old' and 'head' in snapshot mode Sasha Levin
2019-07-15 14:35   ` Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 32/73] perf test 6: Fix missing kvm module load for s390 Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 33/73] gpio: omap: fix lack of irqstatus_raw0 for OMAP4 Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 34/73] gpio: omap: ensure irq is enabled before wakeup Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 35/73] regmap: fix bulk writes on paged registers Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 36/73] bpf: silence warning messages in core Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 37/73] rcu: Force inlining of rcu_read_lock() Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 38/73] blkcg, writeback: dead memcgs shouldn't contribute to writeback ownership arbitration Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 39/73] xfrm: fix sa selector validation Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 40/73] perf evsel: Make perf_evsel__name() accept a NULL argument Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 41/73] vhost_net: disable zerocopy by default Sasha Levin
2019-07-15 14:35   ` Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 42/73] ipoib: correcly show a VF hardware address Sasha Levin
2019-07-15 14:35 ` [PATCH AUTOSEL 4.9 43/73] EDAC/sysfs: Fix memory leak when creating a csrow object Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 44/73] ipsec: select crypto ciphers for xfrm_algo Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 45/73] media: i2c: fix warning same module names Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 46/73] ntp: Limit TAI-UTC offset Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 47/73] timer_list: Guard procfs specific code Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 48/73] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0 Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 49/73] media: coda: fix mpeg2 sequence number handling Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 50/73] media: coda: increment sequence offset for the last returned frame Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 51/73] mt7601u: do not schedule rx_tasklet when the device has been disconnected Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 52/73] x86/build: Add 'set -e' to mkcapflags.sh to delete broken capflags.c Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 53/73] mt7601u: fix possible memory leak when the device is disconnected Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 54/73] ath10k: fix PCIE device wake up failed Sasha Levin
2019-07-15 14:36   ` Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 55/73] perf tools: Increase MAX_NR_CPUS and MAX_CACHES Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 56/73] libata: don't request sense data on !ZAC ATA devices Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 57/73] clocksource/drivers/exynos_mct: Increase priority over ARM arch timer Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 58/73] rslib: Fix decoding of shortened codes Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 59/73] rslib: Fix handling of of caller provided syndrome Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 60/73] ixgbe: Check DDM existence in transceiver before access Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 61/73] crypto: asymmetric_keys - select CRYPTO_HASH where needed Sasha Levin
2019-07-15 14:36   ` Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 62/73] PCI / ACPI: Use cached ACPI device state to get PCI device power state Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 63/73] EDAC: Fix global-out-of-bounds write when setting edac_mc_poll_msec Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 64/73] bcache: check c->gc_thread by IS_ERR_OR_NULL in cache_set_flush() Sasha Levin
2019-07-15 14:36   ` Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 65/73] iwlwifi: mvm: Drop large non sta frames Sasha Levin
2019-07-15 14:36 ` Sasha Levin [this message]
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 67/73] gpiolib: Fix references to gpiod_[gs]et_*value_cansleep() variants Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 68/73] Bluetooth: hci_bcsp: Fix memory leak in rx_skb Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 69/73] Bluetooth: 6lowpan: search for destination address in all peers Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 70/73] Bluetooth: Check state in l2cap_disconnect_rsp Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 71/73] Bluetooth: validate BLE connection interval updates Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 72/73] gtp: fix Illegal context switch in RCU read-side critical section Sasha Levin
2019-07-15 14:36 ` [PATCH AUTOSEL 4.9 73/73] gtp: fix use-after-free in gtp_newlink() Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190715143629.10893-66-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+8a3fc6674bbc3978ed4e@syzkaller.appspotmail.com \
    --cc=tranmanphong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.