]> 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)
commit1d8ee93695d032e589fb31f58d3508ea0544f749
tree0586579e9613a61fb2a1aa3976ce4f0a90f44cd8
parent7d9d62cafa4b877af8e23a27a489d936b00e6fd4
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