Files
lkl_linux/include/linux
Martin KaFai Lau 079082c60a tcx: Fix splat during dev unregister
During unregister_netdevice_many_notify(), the ordering of our concerned
function calls is like this:

  unregister_netdevice_many_notify
    dev_shutdown
	qdisc_put
            clsact_destroy
    tcx_uninstall

The syzbot reproducer triggered a case that the qdisc refcnt is not
zero during dev_shutdown().

tcx_uninstall() will then WARN_ON_ONCE(tcx_entry(entry)->miniq_active)
because the miniq is still active and the entry should not be freed.
The latter assumed that qdisc destruction happens before tcx teardown.

This fix is to avoid tcx_uninstall() doing tcx_entry_free() when the
miniq is still alive and let the clsact_destroy() do the free later, so
that we do not assume any specific ordering for either of them.

If still active, tcx_uninstall() does clear the entry when flushing out
the prog/link. clsact_destroy() will then notice the "!tcx_entry_is_active()"
and then does the tcx_entry_free() eventually.

Fixes: e420bed025 ("bpf: Add fd-based tcx multi-prog infra with link support")
Reported-by: syzbot+376a289e86a0fd02b9ba@syzkaller.appspotmail.com
Reported-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Co-developed-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: syzbot+376a289e86a0fd02b9ba@syzkaller.appspotmail.com
Tested-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/222255fe07cb58f15ee662e7ee78328af5b438e4.1690549248.git.daniel@iogearbox.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-07-31 14:44:02 -07:00
..
2023-06-16 12:27:04 -06:00
2023-05-20 19:20:30 +02:00
2023-06-27 10:47:08 -04:00
2023-05-19 23:23:52 +05:30
2023-06-12 12:17:22 -05:00
2023-06-16 10:08:09 -06:00
2023-05-31 13:06:57 +02:00
2023-05-25 09:26:19 +02:00
2023-04-17 18:01:23 +02:00
2023-06-19 16:19:05 -07:00
2023-06-13 16:49:23 +02:00
2023-06-09 17:30:47 +02:00
2023-05-01 17:50:18 -07:00
2023-05-22 17:38:45 +02:00
2023-06-20 20:17:10 -07:00
2023-05-24 18:08:49 +02:00
2023-06-19 15:08:12 -04:00
2023-06-23 16:59:30 -07:00
2023-06-05 09:36:39 +02:00
2023-06-19 16:19:25 -07:00
2023-05-23 12:55:12 -07:00
2023-06-23 16:59:28 -07:00
2023-05-18 19:52:31 -07:00
2023-06-11 18:22:47 +02:00
2023-06-05 09:36:39 +02:00
2023-06-24 15:50:13 -07:00
2023-04-21 03:02:34 -04:00