[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201015102358.0cdef2ca@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Thu, 15 Oct 2020 10:23:58 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Yonghong Song <yhs@...com>
Cc: <bpf@...r.kernel.org>, <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, <kernel-team@...com>,
Andrii Nakryiko <andriin@...com>,
Vasily Averin <vvs@...tuozzo.com>
Subject: Re: [PATCH net v3] net: fix pos incrementment in
ipv6_route_seq_next
On Wed, 14 Oct 2020 07:46:12 -0700 Yonghong Song wrote:
> Commit 4fc427e05158 ("ipv6_route_seq_next should increase position index")
> tried to fix the issue where seq_file pos is not increased
> if a NULL element is returned with seq_ops->next(). See bug
> https://bugzilla.kernel.org/show_bug.cgi?id=206283
> The commit effectively does:
> - increase pos for all seq_ops->start()
> - increase pos for all seq_ops->next()
>
> For ipv6_route, increasing pos for all seq_ops->next() is correct.
> But increasing pos for seq_ops->start() is not correct
> since pos is used to determine how many items to skip during
> seq_ops->start():
> iter->skip = *pos;
> seq_ops->start() just fetches the *current* pos item.
> The item can be skipped only after seq_ops->show() which essentially
> is the beginning of seq_ops->next().
Applied, queued for stable, thanks!
Powered by blists - more mailing lists