Re: [Bridge] [PATCH net v3] net: bridge: fix vlan stats use-after-free on destruction

2020-05-20 Thread Stephen Hemminger
On Fri, 16 Nov 2018 18:50:01 +0200 Nikolay Aleksandrov wrote: > + if (v->priv_flags & BR_VLFLAG_PER_PORT_STATS) > free_percpu(v->stats); Why not not v->stats == NULL as a flag instead? Then the fact that free_percpu(NULL) is a Nop would mean less code in the bridge driver.

Re: [Bridge] [PATCH net v3] net: bridge: fix vlan stats use-after-free on destruction

2020-04-24 Thread Nikolay Aleksandrov
On 24/04/2020 03:05, Stephen Hemminger wrote: > On Fri, 16 Nov 2018 18:50:01 +0200 > Nikolay Aleksandrov wrote: > >> 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

Re: [Bridge] [PATCH net v3] net: bridge: fix vlan stats use-after-free on destruction

2020-04-23 Thread Stephen Hemminger
On Fri, 16 Nov 2018 18:50:01 +0200 Nikolay Aleksandrov wrote: > 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

Re: [Bridge] [PATCH net v3] net: bridge: fix vlan stats use-after-free on destruction

2018-11-17 Thread David Miller
From: Nikolay Aleksandrov Date: Fri, 16 Nov 2018 18:50:01 +0200 > 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. >

[Bridge] [PATCH net v3] net: bridge: fix vlan stats use-after-free on destruction

2018-11-16 Thread Nikolay Aleksandrov
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