From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C16EBC433EF for ; Mon, 14 Mar 2022 10:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238701AbiCNKzH (ORCPT ); Mon, 14 Mar 2022 06:55:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231263AbiCNKzC (ORCPT ); Mon, 14 Mar 2022 06:55:02 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C0B4DEF0; Mon, 14 Mar 2022 03:53:52 -0700 (PDT) Received: from canpemm500006.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KHCyt70lBzBs03; Mon, 14 Mar 2022 18:51:50 +0800 (CST) Received: from localhost.localdomain (10.175.104.82) by canpemm500006.china.huawei.com (7.192.105.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 14 Mar 2022 18:53:50 +0800 From: Ziyang Xuan To: , , CC: , , Subject: [PATCH net-next 0/3] net: ipvlan: fix potential UAF problem for phy_dev Date: Mon, 14 Mar 2022 19:11:34 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.82] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500006.china.huawei.com (7.192.105.130) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the reference operation to phy_dev of ipvlan to avoid the potential UAF problem under the following known scenario: Someone module puts the NETDEV_UNREGISTER event handler to a work, and phy_dev is accessed in the work handler. But when the work is excuted, phy_dev has been destroyed because upper ipvlan did not get reference to phy_dev correctly. In addition, add net device refcount tracker to ipvlan and fix some error comments for ipvtap module. Ziyang Xuan (3): net: ipvlan: fix potential UAF problem for phy_dev net: ipvlan: add net device refcount tracker net: ipvtap: fix error comments drivers/net/ipvlan/ipvlan.h | 1 + drivers/net/ipvlan/ipvlan_main.c | 13 +++++++++++++ drivers/net/ipvlan/ipvtap.c | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) -- 2.25.1