[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210412105851.24809-1-paskripkin@gmail.com>
Date: Mon, 12 Apr 2021 13:58:51 +0300
From: Pavel Skripkin <paskripkin@...il.com>
To: alex.aring@...il.com, stefan@...enfreihafen.org,
davem@...emloft.net
Cc: linux-wpan@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Pavel Skripkin <paskripkin@...il.com>,
syzbot+bf8b5834b7ec229487ce@...kaller.appspotmail.com
Subject: [PATCH] net: mac802154: fix WARNING in ieee802154_del_device
syzbot reported WARNING in ieee802154_del_device. The problem
was in uninitialized mutex. In case of NL802154_IFTYPE_MONITOR
mutex won't be initialized, but ieee802154_del_device() accessing it.
Reported-by: syzbot+bf8b5834b7ec229487ce@...kaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@...il.com>
---
net/mac802154/iface.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index 1cf5ac09edcb..be8d2a02c882 100644
--- a/net/mac802154/iface.c
+++ b/net/mac802154/iface.c
@@ -599,6 +599,7 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata,
break;
case NL802154_IFTYPE_MONITOR:
+ mutex_init(&sdata->sec_mtx);
sdata->dev->needs_free_netdev = true;
sdata->dev->netdev_ops = &mac802154_monitor_ops;
wpan_dev->promiscuous_mode = true;
--
2.31.1
Powered by blists - more mailing lists