netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ip6_tunnel: fix potential NULL pointer dereference
@ 2014-05-09 18:41 Susant Sahani
  2014-05-09 17:12 ` David Miller
  2014-05-13  4:27 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Susant Sahani @ 2014-05-09 18:41 UTC (permalink / raw)
  To: netdev; +Cc: tgraf

The function ip6_tnl_validate assumes that the rtnl
attribute IFLA_IPTUN_PROTO always be filled . If this
attribute is not filled by  the userspace application
kernel get crashed with NULL pointer dereference. This
patch fixes the potential kernel crash when
IFLA_IPTUN_PROTO is missing .

Signed-off-by: Susant Sahani <susant@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
---
 net/ipv6/ip6_tunnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index b05b609..f6a66bb 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1557,7 +1557,7 @@ static int ip6_tnl_validate(struct nlattr *tb[], struct nlattr *data[])
 {
 	u8 proto;
 
-	if (!data)
+	if (!data || !data[IFLA_IPTUN_PROTO])
 		return 0;
 
 	proto = nla_get_u8(data[IFLA_IPTUN_PROTO]);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-13  4:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-09 18:41 [PATCH] ip6_tunnel: fix potential NULL pointer dereference Susant Sahani
2014-05-09 17:12 ` David Miller
     [not found]   ` <536D0DA8.10106@redhat.com>
2014-05-09 17:19     ` David Miller
2014-05-13  4:27 ` David Miller

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