From 593ba3d7f4695f6a9fdf3ba9f438b40ba0b5abe2 Mon Sep 17 00:00:00 2001 From: Hirofumi Ogawa Date: Sun, 30 Nov 2003 18:40:47 -0800 Subject: [PATCH] [PATCH] Missing initialization of /proc/net/tcp seq_file 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 558fe618276a8..7ea3ed719344b 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -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; } -- 2.53.0