Skip to contentSkip to conversation

IPV6: ipv6_fl_socklist is inadvertently shared.

PATCH In review Masayuki Nakagawa 2 participants 2 messages Mar 16, 2007

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

PATCH 1/1 IPV6: ipv6_fl_socklist is inadvertently shared.

The ipv6_fl_socklist from listening socket is inadvertently shared with new socket created for connection. This leads to a variety of interesting, but fatal, bugs. For example, removing one of the sockets may lead to the other socket's encountering a page fault when the now freed list is referenced.

The fix is to not share the flow label list with the new socket.

net/ipv6/tcp_ipv6.c +1 -0
Index: linux-2.6/net/ipv6/tcp_ipv6.c
===================================================================
@@ -1453,6 +1453,7 @@ static struct sock * tcp_v6_syn_recv_soc
 	   First: no IPv4 options.
 	 */
 	newinet->opt = NULL;
+	newnp->ipv6_fl_list = NULL;
 
 	/* Clone RX bits */
 	newnp->rxopt.all = np->rxopt.all;
maintainer
#1 lore raw

From: Masayuki Nakagawa <[email protected]>
Date: Fri, 16 Mar 2007 10:45:42 -0700

Quoted 9 lines

The ipv6_fl_socklist from listening socket is inadvertently shared with new socket created for connection. This leads to a variety of interesting, but fatal, bugs. For example, removing one of the sockets may lead to the other socket's encountering a page fault when the now freed list is referenced.

The fix is to not share the flow label list with the new socket.

Masayuki-san, thank you very much for this bug fix.

Patch applied.