Files
twx-linux/fs
Len Baker bea655491d 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:47:54 +02:00
..
2020-11-05 11:08:53 +01:00
…
2021-06-30 08:48:14 -04:00
…
…
…
2021-07-20 16:15:46 +02:00
…
…
2021-07-20 16:16:03 +02:00
…
…
2021-08-04 12:23:45 +02:00
…
…
…
…
…
…
…
…
…
…
2021-01-30 13:32:11 +01:00
…
…
…
…
…
2021-05-22 10:59:50 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…