netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH v2 net-next 0/3] net: device tracking improvements
Date: Fri,  4 Feb 2022 14:42:34 -0800	[thread overview]
Message-ID: <20220204224237.2932026-1-eric.dumazet@gmail.com> (raw)

From: Eric Dumazet <edumazet@google.com>

Main goal of this series is to be able to detect the following case
which apparently is still haunting us.

dev_hold_track(dev, tracker_1, GFP_ATOMIC);
    dev_hold(dev);
    dev_put(dev);
    dev_put(dev);              // Should complain loudly here.
dev_put_track(dev, tracker_1); // instead of here (as before this series)


v2: third patch:
  I replaced the dev_put() in linkwatch_do_dev() with __dev_put().

Eric Dumazet (3):
  ref_tracker: implement use-after-free detection
  ref_tracker: add a count of untracked references
  net: refine dev_put()/dev_hold() debugging

 include/linux/netdevice.h   | 69 ++++++++++++++++++++++++-------------
 include/linux/ref_tracker.h |  4 +++
 lib/ref_tracker.c           | 17 ++++++++-
 net/core/dev.c              |  2 +-
 net/core/link_watch.c       |  6 ++--
 5 files changed, 70 insertions(+), 28 deletions(-)

-- 
2.35.0.263.gb82422642f-goog


             reply	other threads:[~2022-02-04 22:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 22:42 Eric Dumazet [this message]
2022-02-04 22:42 ` [PATCH v2 net-next 1/3] ref_tracker: implement use-after-free detection Eric Dumazet
2022-02-04 22:42 ` [PATCH v2 net-next 2/3] ref_tracker: add a count of untracked references Eric Dumazet
2022-02-04 22:42 ` [PATCH v2 net-next 3/3] net: refine dev_put()/dev_hold() debugging Eric Dumazet
2022-02-05 15:40 ` [PATCH v2 net-next 0/3] net: device tracking improvements patchwork-bot+netdevbpf

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=20220204224237.2932026-1-eric.dumazet@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).