netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ziyang Xuan <william.xuanziyang@huawei.com>
To: <davem@davemloft.net>, <kuba@kernel.org>, <netdev@vger.kernel.org>
Cc: <edumazet@google.com>, <sakiwit@gmail.com>,
	<sainath.grandhi@intel.com>, <maheshb@google.com>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH net-next v2 0/3] net: ipvlan: fix potential UAF problem for phy_dev
Date: Fri, 18 Mar 2022 09:56:50 +0800	[thread overview]
Message-ID: <cover.1647568181.git.william.xuanziyang@huawei.com> (raw)

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.

------
v1->v2:
  - Add "Fixes: tag" for fix patches.

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


             reply	other threads:[~2022-03-18  1:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18  1:56 Ziyang Xuan [this message]
2022-03-18  1:57 ` [PATCH net-next v2 1/3] net: ipvlan: fix potential UAF problem for phy_dev Ziyang Xuan
2022-03-18 17:53   ` Jakub Kicinski
2022-03-19  3:32     ` Ziyang Xuan (William)
2022-03-18  1:59 ` [PATCH net-next v2 2/3] net: ipvlan: add net device refcount tracker Ziyang Xuan
2022-03-18  1:59 ` [PATCH net-next v2 3/3] net: ipvtap: fix error comments Ziyang Xuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1647568181.git.william.xuanziyang@huawei.com \
    --to=william.xuanziyang@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maheshb@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=sainath.grandhi@intel.com \
    --cc=sakiwit@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).