netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 1/7] netfilter: nft_osf: add missing check for DREG attribute
Date: Sat, 25 Jan 2020 18:34:09 +0100	[thread overview]
Message-ID: <20200125173415.191571-2-pablo@netfilter.org> (raw)
In-Reply-To: <20200125173415.191571-1-pablo@netfilter.org>

From: Florian Westphal <fw@strlen.de>

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>
---
 net/netfilter/nft_osf.c | 3 +++
 1 file changed, 3 insertions(+)

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)
-- 
2.11.0


  reply	other threads:[~2020-01-25 17:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-25 17:34 [PATCH 0/7] Netfilter fixes for net Pablo Neira Ayuso
2020-01-25 17:34 ` Pablo Neira Ayuso [this message]
2020-01-25 17:34 ` [PATCH 2/7] netfilter: ipset: use bitmap infrastructure completely Pablo Neira Ayuso
2020-01-25 17:34 ` [PATCH 3/7] netfilter: conntrack: sctp: use distinct states for new SCTP connections Pablo Neira Ayuso
2020-01-25 17:34 ` [PATCH 4/7] netfilter: nf_tables_offload: fix check the chain offload flag Pablo Neira Ayuso
2020-01-25 17:34 ` [PATCH 5/7] netfilter: nf_tables: add __nft_chain_type_get() Pablo Neira Ayuso
2020-01-25 17:34 ` [PATCH 6/7] netfilter: nf_tables: autoload modules from the abort path Pablo Neira Ayuso
2020-01-25 17:34 ` [PATCH 7/7] net: Fix skb->csum update in inet_proto_csum_replace16() Pablo Neira Ayuso
2020-01-25 20:40 ` [PATCH 0/7] Netfilter fixes for net David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200125173415.191571-2-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).