netfilter: nf_tables: validate NFTA_SET_TABLE parameter
Subsystems (2)
PATCH 1/1 netfilter: nf_tables: validate NFTA_SET_TABLE parameter
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 <[email protected]>
--- net/netfilter/nf_tables_api.c | 2 ++ 1 file changed, 2 insertions(+)
net/netfilter/nf_tables_api.c +2 -0
@@ -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))
Signature · 1 line
2.8.0
Quoted 3 lines · Phil Turnbull
If the
NFTA_SET_TABLEparameter is missing and theNLM_F_DUMPflag is not set, then a NULL pointer dereference is triggered innf_tables_set_lookupbecause ctx.table is NULL.
Applied, thanks.