Skip to contentSkip to conversation

neigh_stat_seq_next() should increase position index

PATCH In review Vasily Averin 1 participant 1 message Jan 23, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/6 neigh_stat_seq_next() should increase position index

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

---
 net/core/neighbour.c | 1 +
 1 file changed, 1 insertion(+)
net/core/neighbour.c +1 -0
index 920784a..789a73a 100644
@@ -3290,6 +3290,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;
 }
 
Signature · 1 line
1.8.3.1