From: Eric Dumazet <hidden> Date: 2018-03-05 16:51:05
From: Eric Dumazet <redacted>
A tun device type can trivially be set to arbitrary value using
TUNSETLINK ioctl().
Therefore, lowpan_device_event() must really check that ieee802154_ptr
is not NULL.
Fixes: 2c88b5283f60d ("ieee802154: 6lowpan: remove check on null")
Signed-off-by: Eric Dumazet <redacted>
Cc: Alexander Aring <alex.aring@gmail.com>
Cc: Stefan Schmidt <redacted>
Reported-by: syzbot <redacted>
---
net/ieee802154/6lowpan/core.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
From: David Miller <davem@davemloft.net> Date: 2018-03-05 17:00:46
From: Eric Dumazet <redacted>
Date: Mon, 05 Mar 2018 08:51:03 -0800
From: Eric Dumazet <redacted>
A tun device type can trivially be set to arbitrary value using
TUNSETLINK ioctl().
Therefore, lowpan_device_event() must really check that ieee802154_ptr
is not NULL.
Fixes: 2c88b5283f60d ("ieee802154: 6lowpan: remove check on null")
Signed-off-by: Eric Dumazet <redacted>
Cc: Alexander Aring <alex.aring@gmail.com>
Cc: Stefan Schmidt <redacted>
Reported-by: syzbot <redacted>
From: Stefan Schmidt <hidden> Date: 2018-03-06 12:56:57
Hello.
On 03/05/2018 05:51 PM, Eric Dumazet wrote:
quoted hunk
From: Eric Dumazet <redacted>
A tun device type can trivially be set to arbitrary value using
TUNSETLINK ioctl().
Therefore, lowpan_device_event() must really check that ieee802154_ptr
is not NULL.
Fixes: 2c88b5283f60d ("ieee802154: 6lowpan: remove check on null")
Signed-off-by: Eric Dumazet <redacted>
Cc: Alexander Aring <alex.aring@gmail.com>
Cc: Stefan Schmidt <redacted>
Reported-by: syzbot <redacted>
---
net/ieee802154/6lowpan/core.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
Not sure why you think there is a rename from wdev to ndev necessary.
I see this more of a rolled in cosmetic change, but its not a real problem from my side.
quoted hunk
+ struct wpan_dev *wpan_dev;- if (wdev->type != ARPHRD_IEEE802154)+ if (ndev->type != ARPHRD_IEEE802154)+ return NOTIFY_DONE;+ wpan_dev = ndev->ieee802154_ptr;+ if (!wpan_dev) return NOTIFY_DONE; switch (event) {
@@ -217,8 +221,8 @@ static int lowpan_device_event(struct notifier_block *unused, * also delete possible lowpan interfaces which belongs * to the wpan interface. */- if (wdev->ieee802154_ptr->lowpan_dev)- lowpan_dellink(wdev->ieee802154_ptr->lowpan_dev, NULL);+ if (wpan_dev->lowpan_dev)+ lowpan_dellink(wpan_dev->lowpan_dev, NULL); break; default: return NOTIFY_DONE;
Thanks a lot for fixing this and syzbot for finding it.
Acked-by: Stefan Schmidt <redacted>
Dave, could you take this one directly? I have no other patches pending for your net tree (only net-next) and having a pull request for just
this patch does not make much sense.
regards
Stefan Schmidt
From: Stefan Schmidt <hidden> Date: 2018-03-08 16:21:58
Hello Dave.
On 03/06/2018 01:56 PM, Stefan Schmidt wrote:
Hello.
On 03/05/2018 05:51 PM, Eric Dumazet wrote:
quoted
From: Eric Dumazet <redacted>
A tun device type can trivially be set to arbitrary value using
TUNSETLINK ioctl().
Therefore, lowpan_device_event() must really check that ieee802154_ptr
is not NULL.
Fixes: 2c88b5283f60d ("ieee802154: 6lowpan: remove check on null")
Signed-off-by: Eric Dumazet <redacted>
Cc: Alexander Aring <alex.aring@gmail.com>
Cc: Stefan Schmidt <redacted>
Reported-by: syzbot <redacted>
---
net/ieee802154/6lowpan/core.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
Not sure why you think there is a rename from wdev to ndev necessary.
I see this more of a rolled in cosmetic change, but its not a real problem from my side.
quoted
+ struct wpan_dev *wpan_dev;- if (wdev->type != ARPHRD_IEEE802154)+ if (ndev->type != ARPHRD_IEEE802154)+ return NOTIFY_DONE;+ wpan_dev = ndev->ieee802154_ptr;+ if (!wpan_dev) return NOTIFY_DONE; switch (event) {
@@ -217,8 +221,8 @@ static int lowpan_device_event(struct notifier_block *unused, * also delete possible lowpan interfaces which belongs * to the wpan interface. */- if (wdev->ieee802154_ptr->lowpan_dev)- lowpan_dellink(wdev->ieee802154_ptr->lowpan_dev, NULL);+ if (wpan_dev->lowpan_dev)+ lowpan_dellink(wpan_dev->lowpan_dev, NULL); break; default: return NOTIFY_DONE;
Thanks a lot for fixing this and syzbot for finding it.
Acked-by: Stefan Schmidt <redacted>
Dave, could you take this one directly? I have no other patches pending for your net tree (only net-next) and having a pull request for just
this patch does not make much sense.
Did you miss this or would you prefer if I do a pull request for this single patch?
Either way would be fine with me.
regards
Stefan Schmidt