From: Li RongQing <hidden> Date: 2018-10-14 11:01:31
After per-port vlan stats, vlan stats should be released
when fail to add vlan
Fixes: 9163a0fc1f0c0 ("net: bridge: add support for per-port vlan stats")
cc: Nikolay Aleksandrov <redacted>
Signed-off-by: Zhang Yu <redacted>
Signed-off-by: Li RongQing <redacted>
---
net/bridge/br_vlan.c | 4 ++++
1 file changed, 4 insertions(+)
From: Nikolay Aleksandrov <hidden> Date: 2018-10-14 15:33:42
On 14/10/2018 06:21, Li RongQing wrote:
quoted hunk
After per-port vlan stats, vlan stats should be released
when fail to add vlan
Fixes: 9163a0fc1f0c0 ("net: bridge: add support for per-port vlan stats")
cc: Nikolay Aleksandrov <redacted>
Signed-off-by: Zhang Yu <redacted>
Signed-off-by: Li RongQing <redacted>
---
net/bridge/br_vlan.c | 4 ++++
1 file changed, 4 insertions(+)
Hi,
Good catch, but the patch doesn't fix the bug entirely. The problem is that masterv can be
created just for this vlan and the br_vlan_put_master() above can free it, so we can
check a pointer that's not really up-to-date (and thus again leak memory).
You should move the new code above the br_vlan_put_master() call.
Also please tag the proper branch, this is for net-next, and CC all bridge
maintainers (added Roopa).
Thank you,
Nik
From: Li RongQing <hidden> Date: 2018-10-15 16:15:34
quoted
Hi,
Good catch, but the patch doesn't fix the bug entirely. The problem is that masterv can be
created just for this vlan and the br_vlan_put_master() above can free it, so we can
check a pointer that's not really up-to-date (and thus again leak memory).
You should move the new code above the br_vlan_put_master() call.
Also please tag the proper branch, this is for net-next, and CC all bridge
maintainers (added Roopa).