Commit d2ce05d7 authored by Vasily Averin's avatar Vasily Averin Committed by Greg Kroah-Hartman

neigh_stat_seq_next() should increase position index

[ Upstream commit 1e3f9f07 ]

if seq_file .next fuction does not change position index,
read after some lseek can generate unexpected output.

https://bugzilla.kernel.org/show_bug.cgi?id=206283Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent bab62c69
...@@ -2797,6 +2797,7 @@ static void *neigh_stat_seq_next(struct seq_file *seq, void *v, loff_t *pos) ...@@ -2797,6 +2797,7 @@ static void *neigh_stat_seq_next(struct seq_file *seq, void *v, loff_t *pos)
*pos = cpu+1; *pos = cpu+1;
return per_cpu_ptr(tbl->stats, cpu); return per_cpu_ptr(tbl->stats, cpu);
} }
(*pos)++;
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment