提交 2265d5c7 编写于 作者: F Florian Westphal 提交者: Yang Yingliang

netfilter: nft_osf: add missing check for DREG attribute

stable inclusion
from linux-4.19.100
commit 666a530b2e022bc4bd90fe1770f75fae9b1c15b9

--------------------------------

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: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NLi Aichun <liaichun@huawei.com>
Reviewed-by: Nguodeqing <geffrey.guo@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 72f11987
...@@ -47,6 +47,9 @@ static int nft_osf_init(const struct nft_ctx *ctx, ...@@ -47,6 +47,9 @@ static int nft_osf_init(const struct nft_ctx *ctx,
struct nft_osf *priv = nft_expr_priv(expr); struct nft_osf *priv = nft_expr_priv(expr);
int err; int err;
if (!tb[NFTA_OSF_DREG])
return -EINVAL;
priv->dreg = nft_parse_register(tb[NFTA_OSF_DREG]); priv->dreg = nft_parse_register(tb[NFTA_OSF_DREG]);
err = nft_validate_register_store(ctx, priv->dreg, NULL, err = nft_validate_register_store(ctx, priv->dreg, NULL,
NFT_DATA_VALUE, NFT_OSF_MAXGENRELEN); NFT_DATA_VALUE, NFT_OSF_MAXGENRELEN);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册