]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: map_seq_next should always increase position index
authorVasily Averin <vvs@virtuozzo.com>
Sat, 25 Jan 2020 09:10:02 +0000 (12:10 +0300)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 27 Jan 2020 09:54:32 +0000 (10:54 +0100)
commit49389a8c909f5c5937042c267607ab78946561f4
treedcaf37c1d2dd0a92827364fd29a3c1f783fe7ba0
parent75ca585c901825d986cee12963c6deff4b9e5f3a
bpf: map_seq_next should always increase position index

If seq_file .next fuction does not change position index,
read after some lseek can generate an unexpected output.

See also: https://bugzilla.kernel.org/show_bug.cgi?id=206283

v1 -> v2: removed missed increment in end of function

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/eca84fdd-c374-a154-d874-6c7b55fc3bc4@virtuozzo.com
kernel/bpf/inode.c