Commit d7a40345 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by openeuler-sync-bot
Browse files

gfs2: Switch from strlcpy to strscpy

stable inclusion
from stable-v5.10.156
commit a5da76df467a55071c88c7e2612250e91034e4d7
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7MCG1

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a5da76df467a55071c88c7e2612250e91034e4d7



--------------------------------

commit 204c0300 upstream.

Switch from strlcpy to strscpy and make sure that @count is the size of
the smaller of the source and destination buffers.  This prevents
reading beyond the end of the source buffer when the source string isn't
null terminated.

Found by a modified version of syzkaller.

Suggested-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
(cherry picked from commit 16cede18)
parent e1e1b5da
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment