android_kernel_oneplus_msm8998/fs/overlayfs
Vivek Goyal b24be4acd1 ovl: modify ovl_permission() to do checks on two inodes
commit c0ca3d70e8d3cf81e2255a217f7ca402f5ed0862 upstream.

Right now ovl_permission() calls __inode_permission(realinode), to do
permission checks on real inode and no checks are done on overlay inode.

Modify it to do checks both on overlay inode as well as underlying inode.
Checks on overlay inode will be done with the creds of calling task while
checks on underlying inode will be done with the creds of mounter.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
[ Srivatsa: 4.4.y backport:
  - Skipped the hunk modifying non-existent function ovl_get_acl()
  - Adjusted the error path
  - Included linux/cred.h to get prototype for revert_creds() ]
Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-10 09:56:36 +02:00
..
copy_up.c ovl: override creds with the ones from the superblock mounter 2018-09-15 09:40:41 +02:00
dir.c ovl: fix uid/gid when creating over whiteout 2019-04-27 09:33:59 +02:00
inode.c ovl: modify ovl_permission() to do checks on two inodes 2019-07-10 09:56:36 +02:00
Kconfig ovl: rename filesystem type to "overlay" 2014-11-20 16:39:59 +01:00
Makefile ovl: rename filesystem type to "overlay" 2014-11-20 16:39:59 +01:00
overlayfs.h ovl: proper cleanup of workdir 2018-09-15 09:40:41 +02:00
readdir.c ovl: proper cleanup of workdir 2018-09-15 09:40:41 +02:00
super.c ovl: proper cleanup of workdir 2018-09-15 09:40:41 +02:00