]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ovl: Optimize override/revert creds
authorVinicius Costa Gomes <vinicius.gomes@intel.com>
Thu, 14 Nov 2024 08:52:23 +0000 (09:52 +0100)
committerAmir Goldstein <amir73il@gmail.com>
Fri, 15 Nov 2024 07:55:39 +0000 (08:55 +0100)
commitc5b28fc161c5402da2e10cc11637c2dff727ac23
tree06fc8b4a355cc63db9705792e814dc5892e2d626
parent711747e204ead127235aa41b350e518e92a87fcc
ovl: Optimize override/revert creds

Use override_creds_light() in ovl_override_creds() and
revert_creds_light() in ovl_revert_creds().

The _light() functions do not change the 'usage' of the credentials in
question, as they refer to the credentials associated with the
mounter, which have a longer lifetime.

In ovl_setup_cred_for_create(), do not need to modify the mounter
credentials (returned by override_creds_light()) 'usage' counter.
Add a warning to verify that we are indeed working with the mounter
credentials (stored in the superblock). Failure in this assumption
means that creds may leak.

Suggested-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
fs/overlayfs/dir.c
fs/overlayfs/util.c