Re: [PATCH] mm/kasan: switch from strlcpy to strscpy

2021-02-24 Thread Andrey Konovalov
On Mon, Feb 22, 2021 at 8:45 AM Alexander Potapenko wrote: > > On Mon, Feb 22, 2021 at 6:10 AM Zhiyuan Dai wrote: > > > > strlcpy is marked as deprecated in Documentation/process/deprecated.rst, > > and there is no functional difference when the caller expects truncation > > (when not checking

Re: [PATCH] mm/kasan: switch from strlcpy to strscpy

2021-02-21 Thread Alexander Potapenko
On Mon, Feb 22, 2021 at 6:10 AM Zhiyuan Dai wrote: > > strlcpy is marked as deprecated in Documentation/process/deprecated.rst, > and there is no functional difference when the caller expects truncation > (when not checking the return value). strscpy is relatively better as it > also avoids

[PATCH] mm/kasan: switch from strlcpy to strscpy

2021-02-21 Thread Zhiyuan Dai
strlcpy is marked as deprecated in Documentation/process/deprecated.rst, and there is no functional difference when the caller expects truncation (when not checking the return value). strscpy is relatively better as it also avoids scanning the whole source string. Signed-off-by: Zhiyuan Dai ---