ovl: drop CAP_SYS_RESOURCE from saved mounter's credentials
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Tue, 10 Jan 2017 18:30:21 +0000 (21:30 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2017 22:08:03 +0000 (15:08 -0700)
commitfee760fc6c79998efc48bd06afeec31824dfb2d4
tree835dacef044d32652e52696501aea9b99676e59a
parent0fb615f9cad7966267cd1904766a1b3059336f76
ovl: drop CAP_SYS_RESOURCE from saved mounter's credentials

commit 51f8f3c4e22535933ef9aecc00e9a6069e051b57 upstream.

If overlay was mounted by root then quota set for upper layer does not work
because overlay now always use mounter's credentials for operations.
Also overlay might deplete reserved space and inodes in ext4.

This patch drops capability SYS_RESOURCE from saved credentials.
This affects creation new files, whiteouts, and copy-up operations.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: 1175b6b8d963 ("ovl: do operations on underlying file system in mounter's context")
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/overlayfs/super.c