]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.44/net-sched-fix-refcnt-leak-in-the-error-path-of-tcf_vlan_init.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.44 / net-sched-fix-refcnt-leak-in-the-error-path-of-tcf_vlan_init.patch
1 From foo@baz Tue May 22 20:10:42 CEST 2018
2 From: Davide Caratti <dcaratti@redhat.com>
3 Date: Wed, 16 May 2018 12:54:29 +0200
4 Subject: net/sched: fix refcnt leak in the error path of tcf_vlan_init()
5
6 From: Davide Caratti <dcaratti@redhat.com>
7
8 [ Upstream commit 5a4931ae0193f8a4a97e8260fd0df1d705d83299 ]
9
10 Similarly to what was done with commit a52956dfc503 ("net sched actions:
11 fix refcnt leak in skbmod"), fix the error path of tcf_vlan_init() to avoid
12 refcnt leaks when wrong value of TCA_VLAN_PUSH_VLAN_PROTOCOL is given.
13
14 Fixes: 5026c9b1bafc ("net sched: vlan action fix late binding")
15 CC: Roman Mashak <mrv@mojatatu.com>
16 Signed-off-by: Davide Caratti <dcaratti@redhat.com>
17 Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
18 Signed-off-by: David S. Miller <davem@davemloft.net>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 ---
21 net/sched/act_vlan.c | 2 ++
22 1 file changed, 2 insertions(+)
23
24 --- a/net/sched/act_vlan.c
25 +++ b/net/sched/act_vlan.c
26 @@ -154,6 +154,8 @@ static int tcf_vlan_init(struct net *net
27 case htons(ETH_P_8021AD):
28 break;
29 default:
30 + if (exists)
31 + tcf_idr_release(*a, bind);
32 return -EPROTONOSUPPORT;
33 }
34 } else {