ovl: listxattr: use strnlen()
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 1 Sep 2016 09:12:00 +0000 (11:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 06:27:52 +0000 (08:27 +0200)
commit708cb42fcaef0874a81100b461833096564db6cf
treee0d57994e247a08747ee5d8c73854acbd5b76e5f
parentd57a6c748059eb1f90cde4b40091f57617b72609
ovl: listxattr: use strnlen()

commit 7cb35119d067191ce9ebc380a599db0b03cbd9d9 upstream.

Be defensive about what underlying fs provides us in the returned xattr
list buffer.  If it's not properly null terminated, bail out with a warning
insead of BUG.

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