From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net v2 1/1] ipvlan: NULL pointer dereference panic in ipvlan_port_destroy Date: Sat, 18 Nov 2017 10:37:29 +0900 (KST) Message-ID: <20171118.103729.433267100989647193.davem@davemloft.net> References: <1510902977-7931-1-git-send-email-girish.moodalbail@oracle.com> <1510902977-7931-2-git-send-email-girish.moodalbail@oracle.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, mahesh@bandewar.net To: girish.moodalbail@oracle.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:38198 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760205AbdKRBhj (ORCPT ); Fri, 17 Nov 2017 20:37:39 -0500 In-Reply-To: <1510902977-7931-2-git-send-email-girish.moodalbail@oracle.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Girish Moodalbail Date: Thu, 16 Nov 2017 23:16:17 -0800 > 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: 2ad7bf363841 (ipvlan: Initial check-in of the IPVLAN driver) > Signed-off-by: Girish Moodalbail Applied.