]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd1f227100a1fcd3823042d7b35aa37324de6372e
tree68d758c65f564dea50368d3c88418059bb5dc97b
parent09d1214a05b80421c50a72bc3ccbd5e7a8fc2b01
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