net: mac802154: fix WARNING in ieee802154_del_device
Subsystems (3)
PATCH 1/1 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.
--- net/mac802154/iface.c | 1 + 1 file changed, 1 insertion(+)
net/mac802154/iface.c +1 -0
@@ -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;
Signature · 1 line
2.31.1
Alexander Aring
maintainerHi,
Quoted 16 lines · Pavel Skripkin
syzbot reported WARNING in
ieee802154_del_device. The problem was in uninitialized mutex. In case ofNL802154_IFTYPE_MONITORmutex won't be initialized, butieee802154_del_device()accessing it.Reported-by [email protected]Signed-off-by Pavel Skripkin <[email protected]>--- net/mac802154/iface.c | 1 + 1 file changed, 1 insertion(+)net/mac802154/iface.c +0
-0
net/mac802154/iface.c ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, · line 605
Quoted 7 lines
net/mac802154/iface.c +1
-0@@ -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;
yes that will fix the issue, but will let the user notify that setting any security setting is supported by monitors which is not the case. There are patches around which should return -EOPNOTSUPP for monitors. However we might support it in future to let the kernel encrypt air frames, but this isn't supported yet and the user should be aware that it isn't.
- Alex
Hi!
Quoted 23 lines · Alexander Aring
Hi,
Quoted 19 lines · Pavel Skripkin
syzbot reported WARNING in
ieee802154_del_device. The problem was in uninitialized mutex. In case ofNL802154_IFTYPE_MONITORmutex won't be initialized, butieee802154_del_device()accessing it.Reported-by [email protected]Signed-off-by Pavel Skripkin <[email protected]>---
net/mac802154/iface.c | 1 +1 file changed, 1 insertion(+)net/mac802154/iface.c +0
-0@@ -599,6 +599,7 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata,
Quoted 17 lines
Quoted 6 lines
net/mac802154/iface.c +0
-0break;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;yes that will fix the issue, but will let the user notify that setting
any security setting is supported by monitors which is not the case. There are patches around which should return-EOPNOTSUPPfor monitors.
However we might support it in future to let the kernel encrypt air frames, but this isn't supported yet and the user should be aware that
it isn't.
Thank you for your feedback. I am still not familiar with net internals yet :) Next time I ll try to go deeper. Thanks!
Quoted 1 line
- Alex
With regards,
Pavel Skripkin