* [PATCH nf] netfilter: nf_tables: validate NFTA_SET_TABLE parameter
@ 2016-05-27 17:34 Phil Turnbull
2016-05-30 9:33 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Phil Turnbull @ 2016-05-27 17:34 UTC (permalink / raw)
To: netfilter-devel
Cc: Pablo Neira Ayuso, Patrick McHardy, Jozsef Kadlecsik, coreteam,
Phil Turnbull
If the NFTA_SET_TABLE parameter is missing and the NLM_F_DUMP flag is
not set, then a NULL pointer dereference is triggered in
nf_tables_set_lookup because ctx.table is NULL.
Signed-off-by: Phil Turnbull <phil.turnbull@oracle.com>
---
net/netfilter/nf_tables_api.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index c444929..569ba6a 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2647,6 +2647,8 @@ static int nf_tables_getset(struct net *net, struct sock *nlsk,
/* Only accept unspec with dump */
if (nfmsg->nfgen_family == NFPROTO_UNSPEC)
return -EAFNOSUPPORT;
+ if (!nla[NFTA_SET_TABLE])
+ return -EINVAL;
set = nf_tables_set_lookup(ctx.table, nla[NFTA_SET_NAME]);
if (IS_ERR(set))
--
2.8.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH nf] netfilter: nf_tables: validate NFTA_SET_TABLE parameter
2016-05-27 17:34 [PATCH nf] netfilter: nf_tables: validate NFTA_SET_TABLE parameter Phil Turnbull
@ 2016-05-30 9:33 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2016-05-30 9:33 UTC (permalink / raw)
To: Phil Turnbull
Cc: netfilter-devel, Patrick McHardy, Jozsef Kadlecsik, coreteam
On Fri, May 27, 2016 at 01:34:04PM -0400, Phil Turnbull wrote:
> If the NFTA_SET_TABLE parameter is missing and the NLM_F_DUMP flag is
> not set, then a NULL pointer dereference is triggered in
> nf_tables_set_lookup because ctx.table is NULL.
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-30 9:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-27 17:34 [PATCH nf] netfilter: nf_tables: validate NFTA_SET_TABLE parameter Phil Turnbull
2016-05-30 9:33 ` Pablo Neira Ayuso
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.