Commit 666a530b authored by Florian Westphal's avatar Florian Westphal Committed by Greg Kroah-Hartman

netfilter: nft_osf: add missing check for DREG attribute

commit 7eaecf79 upstream.

syzbot reports just another NULL deref crash because of missing test
for presence of the attribute.

Reported-by: syzbot+cf23983d697c26c34f60@syzkaller.appspotmail.com
Fixes:  b96af92d ("netfilter: nf_tables: implement Passive OS fingerprint module in nft_osf")
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f5cdfc16
......@@ -47,6 +47,9 @@ static int nft_osf_init(const struct nft_ctx *ctx,
struct nft_osf *priv = nft_expr_priv(expr);
int err;
if (!tb[NFTA_OSF_DREG])
return -EINVAL;
priv->dreg = nft_parse_register(tb[NFTA_OSF_DREG]);
err = nft_validate_register_store(ctx, priv->dreg, NULL,
NFT_DATA_VALUE, NFT_OSF_MAXGENRELEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment