summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2020-01-23 10:11:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-01 11:11:51 +0200
commit2fa70e389417da2cc54e1bb77aca749f2407ceac (patch)
tree62fc9aaaaa319400673497be5924dc8e7c105319 /net
parent43bdb4af40f4a783fb638a819a58aaf0fda2814e (diff)
neigh_stat_seq_next() should increase position index
[ Upstream commit 1e3f9f073c47bee7c23e77316b07bc12338c5bba ] 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=206283 Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/neighbour.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 9849f1f4cf4f..40d33431bc58 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2798,6 +2798,7 @@ static void *neigh_stat_seq_next(struct seq_file *seq, void *v, loff_t *pos)
*pos = cpu+1;
return per_cpu_ptr(tbl->stats, cpu);
}
+ (*pos)++;
return NULL;
}