Netdev List
 help / color / mirror / Atom feed
From: Dave Kleikamp <shaggy@austin.ibm.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] [IPSEC] Avoid null pointer dereference in xfrm4_rcv_encap
Date: Wed, 05 Apr 2006 09:59:38 -0500	[thread overview]
Message-ID: <1144249178.10340.5.camel@kleikamp.austin.ibm.com> (raw)

I'm getting a panic that I've traced back to this changeset:
http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e695633e21ffb6a443a8c2f8b3f095c7f1a48eb0

xfrm4_rcv_encap dereferences x->encap without testing it for null.

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
--- linux-2.6.17-rc1-mm1/net/ipv4/xfrm4_input.c.orig	2006-04-04
07:37:23.444068000 -0500
+++ linux-2.6.17-rc1-mm1/net/ipv4/xfrm4_input.c	2006-04-05
09:01:08.798510500 -0500
@@ -90,7 +90,7 @@ int xfrm4_rcv_encap(struct sk_buff *skb,
 		if (unlikely(x->km.state != XFRM_STATE_VALID))
 			goto drop_unlock;
 
-		if (x->encap->encap_type != encap_type)
+		if (x->encap && (x->encap->encap_type != encap_type))
 			goto drop_unlock;
 
 		if (x->props.replay_window && xfrm_replay_check(x, seq))

-- 
David Kleikamp
IBM Linux Technology Center

             reply	other threads:[~2006-04-05 14:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-05 14:59 Dave Kleikamp [this message]
2006-04-05 15:41 ` [PATCH] [IPSEC] Avoid null pointer dereference in xfrm4_rcv_encap Dave Kleikamp
2006-04-05 17:10 ` Herbert Xu

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=1144249178.10340.5.camel@kleikamp.austin.ibm.com \
    --to=shaggy@austin.ibm.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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