Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1520479imu; Wed, 28 Nov 2018 10:43:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/XTKG3aXZztLoFwYBF9l6OH7+ltAImr8GXzMjY1ZeXhQAeQAkcBSZllQqmG3McaCBLMShkW X-Received: by 2002:a63:3e05:: with SMTP id l5mr31883636pga.96.1543430624714; Wed, 28 Nov 2018 10:43:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543430624; cv=none; d=google.com; s=arc-20160816; b=lWKnK184zOw3L0DfPx4h0OEQVGIgdvIXQtJTujnWLbrXItw1xHSpJcLrfmvjHDBFJK 1D6rCSQ0tZazFpV4vbhY98N2zcjb2UNavDKdTVVmC2LMDDFcsO0zq1XRFQvxIg1lSLsh r5lKrG1NrlxHwxSt7wgNRHeDMgNlMWAlFutHlx5guYq8A5giIQm1o1f3HwqgkvDyXb4w IxhEPGOs4P7qX8PmqRtd/lT1RL4WRa+npuZOlJzFuY8Hm8m5iNdForr5uwFKggSNwMhz ny2XFoGl0+KlU6J6CoQ1YSn1me7mhvrwVVw7XNH5U9gEfjkaOEEq+mz4z9ROCE8gJUxp UuHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=m6sxwdvSrddesRNjo0VBQnHGF78PUXmmyGlAyU/9hFE=; b=duzFrAgvXX9UHi0RLtgFEBVzkYNO7dyvpPoJ0fnGSD5x+YWeHtmyTNj+1kvJ9tOkJU B2tojqdpNpwVcNspRQewqk21oatkhR3HybGPbu01IagLXfvnt/u0zDU1pg+pqIVfMvlb JNjEBp5PF2Gbly9Dov8Kdw4XI4dlEI8h+a0yFAD+nVVDKdU3CVEESKa2JZxApuUTOHDD U8hPzNzHWJsLoQAhw4JajmuvNlSqnmQKZyzVCTCe3a36h3dho6Sb78d6wiE+wyI/oHmV BDJpWWXijXLusV/xth2odPL6R273x1ib9lOzKkHa4Jr6Cg35jCyR8UPre5W4MS0zkUCq 7VhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si7999624pgh.172.2018.11.28.10.43.25; Wed, 28 Nov 2018 10:43:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727754AbeK2FpH (ORCPT + 99 others); Thu, 29 Nov 2018 00:45:07 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:36110 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725760AbeK2FpH (ORCPT ); Thu, 29 Nov 2018 00:45:07 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 7EE0714E0B2CB; Wed, 28 Nov 2018 10:42:31 -0800 (PST) Date: Wed, 28 Nov 2018 10:42:31 -0800 (PST) Message-Id: <20181128.104231.1536534643328029423.davem@davemloft.net> To: bianpan2016@163.com Cc: yisen.zhuang@huawei.com, salil.mehta@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: hisilicon: remove unexpected free_netdev From: David Miller In-Reply-To: <1543390224-923-1-git-send-email-bianpan2016@163.com> References: <1543390224-923-1-git-send-email-bianpan2016@163.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 28 Nov 2018 10:42:31 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pan Bian Date: Wed, 28 Nov 2018 15:30:24 +0800 > The net device ndev is freed via free_netdev when failing to register > the device. The control flow then jumps to the error handling code > block. ndev is used and freed again. Resulting in a use-after-free bug. > > Signed-off-by: Pan Bian Applied.