Files
linux-stable-mirror/include/linux
Eric Dumazet 4c6c11ea0f net: refine dev_put()/dev_hold() debugging
We are still chasing some syzbot reports where we think a rogue dev_put()
is called with no corresponding prior dev_hold().
Unfortunately it eats a reference on dev->dev_refcnt taken by innocent
dev_hold_track(), meaning that the refcount saturation splat comes
too late to be useful.

Make sure that 'not tracked' dev_put() and dev_hold() better use
CONFIG_NET_DEV_REFCNT_TRACKER=y debug infrastructure:

Prior patch in the series allowed ref_tracker_alloc() and ref_tracker_free()
to be called with a NULL @trackerp parameter, and to use a separate refcount
only to detect too many put() even in the following case:

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

Add clarification about netdev_tracker_alloc() role.

v2: I replaced the dev_put() in linkwatch_do_dev()
    with __dev_put() because callers called netdev_tracker_free().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-02-05 15:22:45 +00:00
..
2022-01-22 08:33:34 +02:00
2022-01-15 08:47:31 -08:00
2022-01-09 10:36:51 -07:00
2022-01-15 08:47:31 -08:00
2022-01-20 08:52:54 +02:00
2022-01-04 13:15:33 -05:00
2022-02-05 15:20:34 +00:00
2022-01-27 13:53:26 +00:00
2022-01-12 10:14:09 -06:00
2022-01-15 16:30:28 +02:00
2022-01-15 16:30:28 +02:00
2022-01-31 11:30:56 +00:00
2022-01-22 08:33:37 +02:00
2022-01-08 12:43:57 -06:00
2022-01-24 14:45:02 +01:00
2022-01-22 08:33:37 +02:00
2022-01-22 08:33:38 +02:00
2022-01-27 13:53:27 +00:00
2021-12-30 12:13:04 +01:00
2022-01-14 18:50:52 -05:00
2022-01-08 00:28:41 -05:00