Re: [PATCH net] net: dsa: fix 'increment on 0' warning

2017-11-25 Thread David Miller
From: Vivien Didelot Date: Fri, 24 Nov 2017 11:36:06 -0500 > Setting the refcount to 0 when allocating a tree to match the number of > switch devices it holds may cause an 'increment on 0; use-after-free', > if CONFIG_REFCOUNT_FULL is enabled. > > To fix

Re: [PATCH net] net: dsa: fix 'increment on 0' warning

2017-11-25 Thread David Miller
From: Vivien Didelot Date: Fri, 24 Nov 2017 11:36:06 -0500 > Setting the refcount to 0 when allocating a tree to match the number of > switch devices it holds may cause an 'increment on 0; use-after-free', > if CONFIG_REFCOUNT_FULL is enabled. > > To fix this, do not decrement the refcount of a

Re: [PATCH net] net: dsa: fix 'increment on 0' warning

2017-11-24 Thread Florian Fainelli
On 11/24/2017 08:36 AM, Vivien Didelot wrote: > Setting the refcount to 0 when allocating a tree to match the number of > switch devices it holds may cause an 'increment on 0; use-after-free', > if CONFIG_REFCOUNT_FULL is enabled. > > To fix this, do not decrement the refcount of a newly

Re: [PATCH net] net: dsa: fix 'increment on 0' warning

2017-11-24 Thread Florian Fainelli
On 11/24/2017 08:36 AM, Vivien Didelot wrote: > Setting the refcount to 0 when allocating a tree to match the number of > switch devices it holds may cause an 'increment on 0; use-after-free', > if CONFIG_REFCOUNT_FULL is enabled. > > To fix this, do not decrement the refcount of a newly

[PATCH net] net: dsa: fix 'increment on 0' warning

2017-11-24 Thread Vivien Didelot
Setting the refcount to 0 when allocating a tree to match the number of switch devices it holds may cause an 'increment on 0; use-after-free', if CONFIG_REFCOUNT_FULL is enabled. To fix this, do not decrement the refcount of a newly allocated tree, increment it when an already allocated tree is

[PATCH net] net: dsa: fix 'increment on 0' warning

2017-11-24 Thread Vivien Didelot
Setting the refcount to 0 when allocating a tree to match the number of switch devices it holds may cause an 'increment on 0; use-after-free', if CONFIG_REFCOUNT_FULL is enabled. To fix this, do not decrement the refcount of a newly allocated tree, increment it when an already allocated tree is