cifsd: fix potential read overflow in ksmbd_vfs_stream_read()
authorNamjae Jeon <namjae.jeon@samsung.com>
Mon, 31 May 2021 08:26:43 +0000 (17:26 +0900)
committerNamjae Jeon <namjae.jeon@samsung.com>
Tue, 1 Jun 2021 00:26:22 +0000 (09:26 +0900)
commit2ae1a6cc43027d84e33819ac4376c5e5e11b4152
tree68d758c65f564dea50368d3c88418059bb5dc97b
parentfd6de099d7fabc2b86f51dc622453eb279f7cce9
cifsd: fix potential read overflow in ksmbd_vfs_stream_read()

If *pos or *pos + count is greater than v_len, It will read beyond
the stream_buf buffer. This patch add the check and cut down count with
size of the buffer.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifsd/vfs.c