summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJiufei Xue <jiufei.xue@linux.alibaba.com>2019-05-06 15:41:02 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-15 11:54:11 +0200
commit22dac6cc9549fec8ceb82ec1cc6da24a9f5a6705 (patch)
tree02bed1042ad96407452aace4aa14f557ee202446 /include
parentb616b9dbc5f613d64224b2e430211211812eadd0 (diff)
ovl: check the capability before cred overridden
commit 98487de318a6f33312471ae1e2afa16fbf8361fe upstream. We found that it return success when we set IMMUTABLE_FL flag to a file in docker even though the docker didn't have the capability CAP_LINUX_IMMUTABLE. The commit d1d04ef8572b ("ovl: stack file ops") and dab5ca8fd9dd ("ovl: add lsattr/chattr support") implemented chattr operations on a regular overlay file. ovl_real_ioctl() overridden the current process's subjective credentials with ofs->creator_cred which have the capability CAP_LINUX_IMMUTABLE so that it will return success in vfs_ioctl()->cap_capable(). Fix this by checking the capability before cred overridden. And here we only care about APPEND_FL and IMMUTABLE_FL, so get these information from inode. [SzM: move check and call to underlying fs inside inode locked region to prevent two such calls from racing with each other] Signed-off-by: Jiufei Xue <jiufei.xue@linux.alibaba.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Cc: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions