[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87im03h9zb.fsf@cjr.nz>
Date: Tue, 17 Aug 2021 21:28:40 -0300
From: Paulo Alcantara <pc@....nz>
To: Len Baker <len.baker@....com>, Steve French <sfrench@...ba.org>,
Jeff Layton <jlayton@...nel.org>,
Suresh Jayaraman <sjayaraman@...e.de>
Cc: Len Baker <len.baker@....com>, linux-cifs@...r.kernel.org,
samba-technical@...ts.samba.org, linux-kernel@...r.kernel.org,
Kees Cook <keescook@...omium.org>,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] CIFS: Fix a potencially linear read overflow
Len Baker <len.baker@....com> writes:
> 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: 066ce6899484d ("cifs: rename cifs_strlcpy_to_host and make it use new functions")
> Signed-off-by: Len Baker <len.baker@....com>
> ---
> fs/cifs/cifs_unicode.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
Reviewed-by: Paulo Alcantara (SUSE) <pc@....nz>
Powered by blists - more mailing lists