Skip to content
Commit c038ae62 authored by Pengcheng Yang's avatar Pengcheng Yang Committed by Greg Kroah-Hartman
Browse files

kernel/relay.c: fix read_pos error when multiple readers



[ Upstream commit 341a7213 ]

When reading, read_pos should start with bytes_consumed, not file->f_pos.
Because when there is more than one reader, the read_pos corresponding to
file->f_pos may have been consumed, which will cause the data that has
been consumed to be read and the bytes_consumed update error.

Signed-off-by: default avatarPengcheng Yang <yangpc@wangsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: default avatarJens Axboe <axboe@kernel.dk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jann Horn <jannh@google.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>e
Link: http://lkml.kernel.org/r/1579691175-28949-1-git-send-email-yangpc@wangsu.com


Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Stable-dep-of: 43ec16f1 ("relayfs: fix out-of-bounds access in relay_file_read")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4f4de392
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment