linux-stable/include
Cong Wang 2e24cd7555 net_sched: fix ops->bind_class() implementations
The current implementations of ops->bind_class() are merely
searching for classid and updating class in the struct tcf_result,
without invoking either of cl_ops->bind_tcf() or
cl_ops->unbind_tcf(). This breaks the design of them as qdisc's
like cbq use them to count filters too. This is why syzbot triggered
the warning in cbq_destroy_class().

In order to fix this, we have to call cl_ops->bind_tcf() and
cl_ops->unbind_tcf() like the filter binding path. This patch does
so by refactoring out two helper functions __tcf_bind_filter()
and __tcf_unbind_filter(), which are lockless and accept a Qdisc
pointer, then teaching each implementation to call them correctly.

Note, we merely pass the Qdisc pointer as an opaque pointer to
each filter, they only need to pass it down to the helper
functions without understanding it at all.

Fixes: 07d79fc7d9 ("net_sched: add reverse binding for tc class")
Reported-and-tested-by: syzbot+0a0596220218fcb603a8@syzkaller.appspotmail.com
Reported-and-tested-by: syzbot+63bdb6006961d8c917c6@syzkaller.appspotmail.com
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-27 10:51:43 +01:00
..
acpi
asm-generic asm-generic/nds32: don't redefine cacheflush primitives 2019-12-30 11:18:43 +01:00
clocksource
crypto
drm drm/dp_mst: Have DP_Tx send one msg at a time 2020-01-15 17:01:21 -05:00
dt-bindings
keys
kunit
kvm
linux bitmap: Introduce bitmap_cut(): cut bits and shift remaining 2020-01-27 08:54:30 +01:00
math-emu
media
misc
net net_sched: fix ops->bind_class() implementations 2020-01-27 10:51:43 +01:00
pcmcia
ras
rdma IB/core: Add interface to advise_mr for kernel users 2020-01-16 16:14:42 +02:00
scsi
soc Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net 2020-01-19 22:10:04 +01:00
sound ASoC: Fixes for v5.5 2019-12-17 14:18:32 +01:00
target
trace Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-01-26 10:40:21 +01:00
uapi netfilter: nf_tables: Support for sets with multiple ranged fields 2020-01-27 08:54:30 +01:00
vdso
video
xen xen/interface: re-define FRONT/BACK_RING_ATTACH() 2019-12-20 13:44:42 +01:00