ieee802154: 6lowpan: fix possible NULL deref in lowpan_device_event()
authorEric Dumazet <edumazet@google.com>
Mon, 5 Mar 2018 16:51:03 +0000 (08:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Mar 2018 16:10:40 +0000 (18:10 +0200)
commitf6cdb675ca0a0f1e1913b48060414933dbd08565
tree13d9ba4adaf5d4ac9028eaae8a4d7bf3439d8a74
parentf77ff13a06c1185491169b78e33bfb6a169a933c
ieee802154: 6lowpan: fix possible NULL deref in lowpan_device_event()

[ Upstream commit ca0edb131bdf1e6beaeb2b8289fd6b374b74147d ]

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 <edumazet@google.com>
Cc: Alexander Aring <alex.aring@gmail.com>
Cc: Stefan Schmidt <stefan@osg.samsung.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Acked-by: Stefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ieee802154/6lowpan/core.c