linux-sg2042/fs/overlayfs
Amir Goldstein 6781069307 ovl: fix wrong use of impure dir cache in ovl_iterate()
Only upper dir can be impure, but if we are in the middle of
iterating a lower real dir, dir could be copied up and marked
impure. We only want the impure cache if we started iterating
a real upper dir to begin with.

Aditya Kali reported that the following reproducer hits the
WARN_ON(!cache->refcount) in ovl_get_cache():

 docker run --rm drupal:8.5.4-fpm-alpine \
    sh -c 'cd /var/www/html/vendor/symfony && \
           chown -R www-data:www-data . && ls -l .'

Reported-by: Aditya Kali <adityakali@google.com>
Tested-by: Aditya Kali <adityakali@google.com>
Fixes: 4edb83bb10 ('ovl: constant d_ino for non-merge dirs')
Cc: <stable@vger.kernel.org> # v4.14
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2018-07-17 16:04:34 +02:00
..
Kconfig ovl: Kconfig documentation fixes 2018-05-31 11:06:10 +02:00
Makefile ovl: encode pure upper file handles 2018-01-24 11:25:59 +01:00
copy_up.c ovl: clean up copy-up error paths 2018-05-31 11:06:11 +02:00
dir.c ovl: use inode_insert5() to hash a newly created inode 2018-05-31 11:06:12 +02:00
export.c ovl: Pass argument to ovl_get_inode() in a structure 2018-05-31 11:06:12 +02:00
inode.c vfs/y2038: inode timestamps conversion to timespec64 2018-06-15 07:31:07 +09:00
namei.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
overlayfs.h vfs/y2038: inode timestamps conversion to timespec64 2018-06-15 07:31:07 +09:00
ovl_entry.h ovl: add support for "xino" mount and config options 2018-04-12 12:04:50 +02:00
readdir.c ovl: fix wrong use of impure dir cache in ovl_iterate() 2018-07-17 16:04:34 +02:00
super.c ovl: return dentry from ovl_create_real() 2018-05-31 11:06:11 +02:00
util.c ovl: constant st_ino for non-samefs with xino 2018-04-12 12:04:50 +02:00