]> git.baikalelectronics.ru Git - kernel.git/commit
ipvlan: NULL pointer dereference panic in ipvlan_port_destroy
authorGirish Moodalbail <girish.moodalbail@oracle.com>
Fri, 17 Nov 2017 07:16:17 +0000 (23:16 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 18 Nov 2017 01:37:00 +0000 (10:37 +0900)
commit790f2638efe0a058ddedf75087f1ea1438da3517
treeda29d087913ef4c822a8003aa0415b8bac1f5d11
parent6550bcbcd4589fca9c80fd336df96f9a71c55686
ipvlan: NULL pointer dereference panic in ipvlan_port_destroy

When call to register_netdevice() (called from ipvlan_link_new()) fails,
we call ipvlan_uninit() (through ndo_uninit()) to destroy the ipvlan
port. After returning unsuccessfully from register_netdevice() we go
ahead and call ipvlan_port_destroy() again which causes NULL pointer
dereference panic. Fix the issue by making ipvlan_init() and
ipvlan_uninit() call symmetric.

The ipvlan port will now be created inside ipvlan_init() and will be
destroyed in ipvlan_uninit().

Fixes: 35b69229bc37 (ipvlan: Initial check-in of the IPVLAN driver)
Signed-off-by: Girish Moodalbail <girish.moodalbail@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipvlan/ipvlan_main.c