Skip to contentSkip to conversation

ct_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 1/4 ct_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_conntrack_standalone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_conntrack_standalone.c +1 -1
index 410809c..4912069 100644
@@ -411,7 +411,7 @@ static void *ct_cpu_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 		*pos = cpu + 1;
 		return per_cpu_ptr(net->ct.stat, cpu);
 	}
-
+	(*pos)++;
 	return NULL;
 }
 
Signature · 1 line
1.8.3.1