diff options
author | Florian Westphal <fw@strlen.de> | 2020-01-18 13:27:25 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-01-18 23:18:41 +0300 |
commit | 7eaecf7963c1c8f62d62c6a8e7c439b0e7f2d365 (patch) | |
tree | 6a92db0a598fc59b45ce86400542a92a90033e97 /net | |
parent | e02d9c4c68dc0ca08ded9487720bba775c09669b (diff) | |
download | linux-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.c | 3 |
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) |