xt_mttg_seq_next should increase position index
Subsystems (2)
PATCH 4/4 xt_mttg_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
Signed-off-by Vasily Averin <[email protected]>
--- net/netfilter/x_tables.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/netfilter/x_tables.c +3 -3
@@ -1551,6 +1551,9 @@ static void *xt_mttg_seq_next(struct seq_file *seq, void *v, loff_t *ppos,uint8_t nfproto = (unsigned long )PDE_DATA (file_inode (seq->file));struct nf_mttg_trav *trav = seq->private; +if (ppos !=NULL ) + ++(*ppos); +switch (trav->class) {case MTTG_TRAV_INIT : trav->class =MTTG_TRAV_NFP_UNSPEC ;
@@ -1576,9 +1579,6 @@ static void *xt_mttg_seq_next(struct seq_file *seq, void *v, loff_t *ppos,default :return NULL ; } - -if (ppos !=NULL ) - ++*ppos;return trav; }
Signature · 1 line
1.8.3.1