summaryrefslogtreecommitdiff
path: root/fs/overlayfs/namei.c
diff options
context:
space:
mode:
authorYuxuan Shui <yshuiv7@gmail.com>2020-05-27 04:08:02 +0100
committerMiklos Szeredi <mszeredi@redhat.com>2020-06-04 10:48:19 +0200
commit520da69d265a91c6536c63851cbb8a53946974f0 (patch)
tree37ae05261af938a395cb160d77d6c0f9a3f7e78b /fs/overlayfs/namei.c
parent1434a65ea625c51317ccdf06dabf4bd27d20fa10 (diff)
ovl: initialize error in ovl_copy_xattr
In ovl_copy_xattr, if all the xattrs to be copied are overlayfs private xattrs, the copy loop will terminate without assigning anything to the error variable, thus returning an uninitialized value. If ovl_copy_xattr is called from ovl_clear_empty, this uninitialized error value is put into a pointer by ERR_PTR(), causing potential invalid memory accesses down the line. This commit initialize error with 0. This is the correct value because when there's no xattr to copy, because all xattrs are private, ovl_copy_xattr should succeed. This bug is discovered with the help of INIT_STACK_ALL and clang. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com> Link: https://bugs.chromium.org/p/chromium/issues/detail?id=1050405 Fixes: 0956254a2d5b ("ovl: don't copy up opaqueness") Cc: stable@vger.kernel.org # v4.8 Signed-off-by: Alexander Potapenko <glider@google.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/namei.c')
0 files changed, 0 insertions, 0 deletions