From: Herbert Xu Date: Sun, 16 Dec 2007 22:04:02 +0000 (-0800) Subject: [PACKET]: Fix /proc/net/packet crash due to bogus private pointer X-Git-Tag: v2.6.25-rc1~1162^2~1064 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=1bf40954cf232a043a49623cf251f787c1871e64;p=linux-2.6-omap-h63xx.git [PACKET]: Fix /proc/net/packet crash due to bogus private pointer The seq_open_net patch changed the meaning of seq->private. Unfortunately it missed two spots in AF_PACKET, which still used the old way of dereferencing seq->private, thus causing weird and wonderful crashes when reading /proc/net/packet. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 485af5691d6..43e49f46ad4 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1878,7 +1878,7 @@ static void *packet_seq_start(struct seq_file *seq, loff_t *pos) static void *packet_seq_next(struct seq_file *seq, void *v, loff_t *pos) { - struct net *net = seq->private; + struct net *net = seq_file_net(seq); ++*pos; return (v == SEQ_START_TOKEN) ? sk_head(&net->packet.sklist) @@ -1887,7 +1887,7 @@ static void *packet_seq_next(struct seq_file *seq, void *v, loff_t *pos) static void packet_seq_stop(struct seq_file *seq, void *v) { - struct net *net = seq->private; + struct net *net = seq_file_net(seq); read_unlock(&net->packet.sklist_lock); }