[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190224.173235.1010392228014903694.davem@davemloft.net>
Date: Sun, 24 Feb 2019 17:32:35 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: dcaratti@...hat.com
Cc: vladbu@...lanox.com, xiyou.wangcong@...il.com, jhs@...atatu.com,
jiri@...nulli.us, netdev@...r.kernel.org
Subject: Re: [PATCH net] net/sched: act_skbedit: fix refcount leak when
replace fails
From: Davide Caratti <dcaratti@...hat.com>
Date: Fri, 22 Feb 2019 12:33:26 +0100
> when act_skbedit was converted to use RCU in the data plane, we added an
> error path, but we forgot to drop the action refcount in case of failure
> during a 'replace' operation:
>
> # tc actions add action skbedit ptype otherhost pass index 100
> # tc action show action skbedit
> total acts 1
>
> action order 0: skbedit ptype otherhost pass
> index 100 ref 1 bind 0
> # tc actions replace action skbedit ptype otherhost drop index 100
> RTNETLINK answers: Cannot allocate memory
> We have an error talking to the kernel
> # tc action show action skbedit
> total acts 1
>
> action order 0: skbedit ptype otherhost pass
> index 100 ref 2 bind 0
>
> Ensure we call tcf_idr_release(), in case 'params_new' allocation failed,
> also when the action is being replaced.
>
> Fixes: c749cdda9089 ("net/sched: act_skbedit: don't use spinlock in the data path")
> Signed-off-by: Davide Caratti <dcaratti@...hat.com>
Also applied and queued up for -stable.
Powered by blists - more mailing lists