summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2020-01-18 13:27:25 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2020-01-18 23:18:41 +0300
commit7eaecf7963c1c8f62d62c6a8e7c439b0e7f2d365 (patch)
tree6a92db0a598fc59b45ce86400542a92a90033e97 /net
parente02d9c4c68dc0ca08ded9487720bba775c09669b (diff)
downloadlinux-7eaecf7963c1c8f62d62c6a8e7c439b0e7f2d365.tar.xz
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: b96af92d6eaf9fadd ("netfilter: nf_tables: implement Passive OS fingerprint module in nft_osf") Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nft_osf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netfilter/nft_osf.c b/net/netfilter/nft_osf.c
index f54d6ae15bb1..b42247aa48a9 100644
--- a/net/netfilter/nft_osf.c
+++ b/net/netfilter/nft_osf.c
@@ -61,6 +61,9 @@ static int nft_osf_init(const struct nft_ctx *ctx,
int err;
u8 ttl;
+ if (!tb[NFTA_OSF_DREG])
+ return -EINVAL;
+
if (tb[NFTA_OSF_TTL]) {
ttl = nla_get_u8(tb[NFTA_OSF_TTL]);
if (ttl > 2)