kernel/relay.c: fix read_pos error when multiple readers
stable inclusion from stable-v4.19.283 commit 2a6c63d04d89227ee45d0234c8059e2bccc15d73 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I7E5C1 CVE: CVE-2023-3268 ---------------------------------------- [ 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:Pengcheng Yang <yangpc@wangsu.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Reviewed-by:
Jens 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:
Linus Torvalds <torvalds@linux-foundation.org> Stable-dep-of: 43ec16f1 ("relayfs: fix out-of-bounds access in relay_file_read") Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
GONG, Ruiqi <gongruiqi1@huawei.com> Reviewed-by:
Wang Weiyang <wangweiyang2@huawei.com> Reviewed-by:
Xiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by:
Yongqiang Liu <liuyongqiang13@huawei.com>
Loading
Please sign in to comment