Skip to contentSkip to conversation

synproxy_cpu_seq_next should increase position index

PATCH New Vasily Averin 1 participant 1 message Jan 23, 2020

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

PATCH 2/4 synproxy_cpu_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/netfilter/nf_synproxy_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_synproxy_core.c +1 -1
index b0930d4a..b9cbe1e 100644
@@ -267,7 +267,7 @@ static void *synproxy_cpu_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 		*pos = cpu + 1;
 		return per_cpu_ptr(snet->stats, cpu);
 	}
-
+	(*pos)++;
 	return NULL;
 }
 
Signature · 1 line
1.8.3.1