ovl: copy_up_xattr(): use strnlen
authorMiklos Szeredi <mszeredi@redhat.com>
Fri, 16 Sep 2016 12:12:11 +0000 (14:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Oct 2016 07:01:30 +0000 (03:01 -0400)
commit714ac6de4454bd134f5bc0777e2bc7c5c50629db
tree89808a322c924a057fe786596fdb569e1165293a
parent0a5600d83fa5a251c91459779d5311a005e4c5b3
ovl: copy_up_xattr(): use strnlen

commit 8b326c61de08f5ca4bc454a168f19e7e43c4cc2a upstream.

Be defensive about what underlying fs provides us in the returned xattr
list buffer.  strlen() may overrun the buffer, so use strnlen() and WARN if
the contents are not properly null terminated.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/overlayfs/copy_up.c