9d332e69c1
Syzbot reported a use-after-free of the global vlan context on port vlan
destruction. When I added per-port vlan stats I missed the fact that the
global vlan context can be freed before the per-port vlan rcu callback.
There're a few different ways to deal with this, I've chosen to add a
new private flag that is set only when per-port stats are allocated so
we can directly check it on destruction without dereferencing the global
context at all. The new field in net_bridge_vlan uses a hole.
v2: cosmetic change, move the check to br_process_vlan_info where the
other checks are done
v3: add change log in the patch, add private (in-kernel only) flags in a
hole in net_bridge_vlan struct and use that instead of mixing
user-space flags with private flags
Fixes:
|
||
---|---|---|
.. | ||
netfilter | ||
Kconfig | ||
Makefile | ||
br.c | ||
br_arp_nd_proxy.c | ||
br_device.c | ||
br_fdb.c | ||
br_forward.c | ||
br_if.c | ||
br_input.c | ||
br_ioctl.c | ||
br_mdb.c | ||
br_multicast.c | ||
br_netfilter_hooks.c | ||
br_netfilter_ipv6.c | ||
br_netlink.c | ||
br_netlink_tunnel.c | ||
br_nf_core.c | ||
br_private.h | ||
br_private_stp.h | ||
br_private_tunnel.h | ||
br_stp.c | ||
br_stp_bpdu.c | ||
br_stp_if.c | ||
br_stp_timer.c | ||
br_switchdev.c | ||
br_sysfs_br.c | ||
br_sysfs_if.c | ||
br_vlan.c | ||
br_vlan_tunnel.c |