Skip to contentSkip to conversation

ip6_tunnel: fix potential NULL pointer dereference

PATCH In review Susant Sahani 2 participants 4 messages May 9, 2014 – May 13, 2014 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip6_tunnel: fix potential NULL pointer dereference

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 .

---
 net/ipv6/ip6_tunnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6_tunnel.c +1 -1
index b05b609..f6a66bb 100644
@@ -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]);
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw

From: Susant Sahani <[email protected]>
Date: Sat, 10 May 2014 00:11:32 +0530

Quoted 9 lines

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 .

You really need to fix the date on your computer, it was not Saturday May 10th when you submitted this patch.

A message that is not in the archive (sent off-list or not yet received): [email protected]

maintainer
#3 lore raw

From: Susant Sahani <[email protected]>
Date: Fri, 09 May 2014 22:47:28 +0530

Quoted 11 lines · David Miller
Quoted 10 lines

From: Susant Sahani <[email protected]>
Date: Sat, 10 May 2014 00:11:32 +0530

Quoted 7 lines

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 .

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

You really need to fix the date on your computer, it was not Saturday May 10th when you submitted this patch.

Do you want me to resend it again ?

It's not necessary this time, but just realize that this makes my work harder because your patch looked like the most recent one submitted in patchwork because the date was always newer than anything else being submitted meanwhile.

maintainer
#4 lore raw
In reply to Susant Sahani

From: Susant Sahani <[email protected]>
Date: Sat, 10 May 2014 00:11:32 +0530

Quoted 9 lines

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 .

Applied and queued up for -stable, thanks.