]> git.baikalelectronics.ru Git - kernel.git/commit
orangefs: strncpy -> strscpy
authorMartin Brandenburg <martin@omnibond.com>
Fri, 8 Apr 2016 17:33:21 +0000 (13:33 -0400)
committerMike Marshall <hubcap@omnibond.com>
Fri, 8 Apr 2016 18:10:34 +0000 (14:10 -0400)
commit4e87375668f8c6fbd61e3ead2bcb6ba4c0179f93
tree6c937fb77a9ccae02a99c9c3fb80db83040d577a
parent3077dba7da2e43a0902398df4c700fe0a463267d
orangefs: strncpy -> strscpy

It would have been possible for a rogue client-core to send in a symlink
target which is not NUL terminated. This returns EIO if the client-core
gives us corrupt data.

Leave debugfs and superblock code as is for now.

Other dcache.c and namei.c strncpy instances are safe because
ORANGEFS_NAME_MAX = NAME_MAX + 1; there is always enough space for a
name plus a NUL byte.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
fs/orangefs/orangefs-utils.c