Files
twx-linux/fs
Len Baker 8878af7807 CIFS: Fix a potencially linear read overflow
[ Upstream commit f980d055a0 ]

strlcpy() reads the entire source buffer first. This read may exceed the
destination size limit. This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated.

Also, the strnlen() call does not avoid the read overflow in the strlcpy
function when a not NUL-terminated string is passed.

So, replace this block by a call to kstrndup() that avoids this type of
overflow and does the same.

Fixes: 066ce68994 ("cifs: rename cifs_strlcpy_to_host and make it use new functions")
Signed-off-by: Len Baker <len.baker@gmx.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-22 11:43:01 +02:00
..
2020-11-10 10:23:59 +01:00
…
2020-01-29 10:24:34 +01:00
…
…
…
2021-07-20 16:21:00 +02:00
…
2020-08-21 11:02:08 +02:00
2021-07-20 16:21:08 +02:00
…
…
2021-08-04 11:58:02 +02:00
…
…
…
…
…
…
…
…
…
…
2021-02-03 23:19:49 +01:00
…
…
…
2020-04-02 17:20:27 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…