Subject: [PATCH] NULL pointer oops on 3.13 vs2.3.6.10
From: Jan Rękorajski <baggins@sith.mimuw.edu.pl>
Date: Thu, 20 Feb 2014 17:08:41 +0100
Thu, 20 Feb 2014 17:08:41 +0100
Hi,
Due to misplaced parentheses in af_netlink.c vserver-enabled 3.13 kernel
oopses when running lsof. Attached patch fixes this (apply on top of
patch-3.13.1-vs2.3.6.10.diff).

-- 
Jan Rękorajski                                 | PLD/Linux
SysAdm                                         | http://www.pld-linux.org/
baggins<at>mimuw.edu.pl
baggins<at>pld-linux.org


--- linux-3.13.3/net/netlink/af_netlink.c	2014-02-20 16:52:23.684218550 +0100
+++ linux-3.13.3/net/netlink/af_netlink.c	2014-02-20 16:54:03.065383489 +0100
@@ -2891,8 +2891,8 @@
 	s = v;
 	do {
 		s = sk_next(s);
-	} while ((s && !nl_table[s->sk_protocol].compare(net, s)) ||
-		!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT));
+	} while (s && (!nl_table[s->sk_protocol].compare(net, s) ||
+		!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT)));
 	if (s)
 		return s;
 
@@ -2905,8 +2905,8 @@
 		for (; j <= hash->mask; j++) {
 			s = sk_head(&hash->table[j]);
 
-			while ((s && !nl_table[s->sk_protocol].compare(net, s)) ||
-				!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT))
+			while (s && (!nl_table[s->sk_protocol].compare(net, s) ||
+				!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT)))
 				s = sk_next(s);
 			if (s) {
 				iter->link = i;