1 From: Hangbin Liu <liuhangbin@gmail.com>
2 Date: Mon, 25 Dec 2017 11:34:54 +0800
3 Subject: [PATCH] netfilter: nf_tables: fix potential NULL-ptr deref in
4 nf_tables_dump_obj_done()
6 If there is no NFTA_OBJ_TABLE and NFTA_OBJ_TYPE, the c.data will be NULL in
7 nf_tables_getobj(). So before free filter->table in nf_tables_dump_obj_done(),
8 we need to check if filter is NULL first.
10 Fixes: e46abbcc05aa ("netfilter: nf_tables: Allow table names of up to 255 chars")
11 Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
12 Acked-by: Phil Sutter <phil@nwl.cc>
13 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 --- a/net/netfilter/nf_tables_api.c
17 +++ b/net/netfilter/nf_tables_api.c
18 @@ -5262,8 +5262,10 @@ static int nf_tables_dump_flowtable_done
22 - kfree(filter->table);
25 + kfree(filter->table);