UPSTREAM: net/sched: cls_u32: fix possible leak in u32_init_knode()
[ Upstream commit ec5b0f60 ] While investigating a related syzbot report, I found that whenever call to tcf_exts_init() from u32_init_knode() is failing, we end up with an elevated refcount on ht->refcnt To avoid that, only increase the refcount after all possible errors have been evaluated. Fixes: b9a24bb7 ("net_sched: properly handle failure case of tcf_exts_init()") Signed-off-by:Eric Dumazet <edumazet@google.com> Cc: Cong Wang <xiyou.wangcong@gmail.com> Cc: Jiri Pirko <jiri@resnulli.us> Acked-by:
Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> (cherry picked from commit 8c5ca649) Signed-off-by:
Greg Kroah-Hartman <gregkh@google.com> Change-Id: I2339e3b17fc1e0dcec0fa1ab27354602f778d093
Loading
Please sign in to comment