]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Switch from strlcpy to strscpy
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 26 Aug 2022 13:12:17 +0000 (15:12 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Fri, 26 Aug 2022 13:27:06 +0000 (15:27 +0200)
commitfa205bd7f3b408972d5cc5bbc4bc8f855ef0dc42
tree0586579e9613a61fb2a1aa3976ce4f0a90f44cd8
parent4b74887b5ca37b9810d373a98f3a15bcfd7e6864
gfs2: Switch from strlcpy to strscpy

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: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/ops_fstype.c