]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Missing initialization of /proc/net/tcp seq_file
authorHirofumi Ogawa <hirofumi@mail.parknet.co.jp>
Mon, 1 Dec 2003 02:40:47 +0000 (18:40 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 1 Dec 2003 02:40:47 +0000 (18:40 -0800)
We need to initialize st->state in tcp_seq_start().  Otherwise
tcp_seq_stop() is run with previous st->state, and it calls the unneeded
unlock etc, causing a kernel crash.

net/ipv4/tcp_ipv4.c

index 558fe618276a864c47fe5651a6e73789c0efdeaf..7ea3ed719344b7d6eadeb7e63b87c9333716d168 100644 (file)
@@ -2356,6 +2356,7 @@ static void *tcp_get_idx(struct seq_file *seq, loff_t pos)
 static void *tcp_seq_start(struct seq_file *seq, loff_t *pos)
 {
        struct tcp_iter_state* st = seq->private;
+       st->state = TCP_SEQ_STATE_LISTENING;
        st->num = 0;
        return *pos ? tcp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
 }