提交 7eaecf79 编写于 作者: F Florian Westphal 提交者: Pablo Neira Ayuso

netfilter: nft_osf: add missing check for DREG attribute

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: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 e02d9c4c
...@@ -61,6 +61,9 @@ static int nft_osf_init(const struct nft_ctx *ctx, ...@@ -61,6 +61,9 @@ static int nft_osf_init(const struct nft_ctx *ctx,
int err; int err;
u8 ttl; u8 ttl;
if (!tb[NFTA_OSF_DREG])
return -EINVAL;
if (tb[NFTA_OSF_TTL]) { if (tb[NFTA_OSF_TTL]) {
ttl = nla_get_u8(tb[NFTA_OSF_TTL]); ttl = nla_get_u8(tb[NFTA_OSF_TTL]);
if (ttl > 2) if (ttl > 2)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册