Skip to content
Commit cf5eebae authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Al Viro
Browse files

seq_file: fix incomplete reset on read from zero offset



When resetting iterator on a zero offset we need to discard any data
already in the buffer (count), and private state of the iterator (version).

For example this bug results in first line being repeated in /proc/mounts
if doing a zero size read before a non-zero size read.

Reported-by: default avatarRich Felker <dalias@libc.org>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Fixes: e522751d ("seq_file: reset iterator to first record for zero offset")
Cc: <stable@vger.kernel.org> # v4.10
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent ba87977a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment