summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2020-01-23 10:11:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-05 14:18:28 +0000
commit964646964ef4028148b5916f6ad5b55a2d9c9152 (patch)
tree58882e3e4fda96e6a24d8c5c82254bd0056590d5
parentb2fd13e9ced42f35deb3faa0b65966ec9fd237a4 (diff)
downloadlinux-stable-964646964ef4028148b5916f6ad5b55a2d9c9152.tar.gz
linux-stable-964646964ef4028148b5916f6ad5b55a2d9c9152.tar.bz2
linux-stable-964646964ef4028148b5916f6ad5b55a2d9c9152.zip
l2t_seq_next should increase position index
[ Upstream commit 66018a102f7756cf72db4d2704e1b93969d9d332 ] 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>
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/l2t.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
index f7ef8871dd0b..67aa3c997417 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
@@ -682,8 +682,7 @@ static void *l2t_seq_start(struct seq_file *seq, loff_t *pos)
static void *l2t_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
v = l2t_get_idx(seq, *pos);
- if (v)
- ++*pos;
+ ++(*pos);
return v;
}