Skip to content

Commit

Permalink
[PACKET]: Fix /proc/net/packet crash due to bogus private pointer
Browse files Browse the repository at this point in the history
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 <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jan 28, 2008
1 parent 2d4d298 commit 1bf4095
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}

Expand Down

0 comments on commit 1bf4095

Please sign in to comment.