From: Cong Wang <amwang@redhat.com>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>, Cong Wang <amwang@redhat.com>
Subject: [Patch net-next] ipv6: fix a potential NULL deref
Date: Mon, 29 Oct 2012 11:50:20 +0800 [thread overview]
Message-ID: <1351482620-11008-1-git-send-email-amwang@redhat.com> (raw)
In ipv6_del_addr():
if (rt != net->ipv6.ip6_null_entry &&
addrconf_is_prefix_route(rt)) {
if (onlink == 0) {
ip6_del_rt(rt);
rt = NULL;
} else if (!(rt->rt6i_flags & RTF_EXPIRES)) {
rt6_set_expires(rt, expires);
}
}
dst_release(&rt->dst);
obviously rt could be NULL'd before dst_release(), so
we have to check if rt is NULL before calling it.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8f0b12a..c467dbb 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -951,7 +951,8 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
rt6_set_expires(rt, expires);
}
}
- dst_release(&rt->dst);
+ if (rt)
+ dst_release(&rt->dst);
}
/* clean up prefsrc entries */
next reply other threads:[~2012-10-29 3:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-29 3:50 Cong Wang [this message]
2012-10-29 6:10 ` [Patch net-next] ipv6: fix a potential NULL deref Eric Dumazet
2012-10-29 6:49 ` Cong Wang
2012-10-29 7:05 ` Eric Dumazet
2012-10-29 7:25 ` Cong Wang
2012-10-29 8:25 ` Eric Dumazet
2012-10-29 17:29 ` David Miller
2012-10-30 1:44 ` Cong Wang
2012-10-29 17:22 ` David Miller
2012-10-29 8:16 ` [Patch net-next] ipv6: remove another useless NULL check Cong Wang
2012-10-29 8:33 ` Eric Dumazet
2012-10-29 9:08 ` Cong Wang
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=1351482620-11008-1-git-send-email-amwang@redhat.com \
--to=amwang@redhat.com \
--cc=davem@davemloft.net \
--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;
as well as URLs for NNTP newsgroup(s).