mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
ovl: add override_creds cleanup guard extension for overlayfs
Overlayfs plucks the relevant creds from the superblock. Extend the override_creds cleanup class I added to override_creds_ovl which uses the ovl_override_creds() function as initialization helper. Add with_ovl_creds() based on this new class. Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-1-b31603935724@kernel.org Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -457,6 +457,11 @@ struct dentry *ovl_workdir(struct dentry *dentry);
|
||||
const struct cred *ovl_override_creds(struct super_block *sb);
|
||||
void ovl_revert_creds(const struct cred *old_cred);
|
||||
|
||||
EXTEND_CLASS(override_creds, _ovl, ovl_override_creds(sb), struct super_block *sb)
|
||||
|
||||
#define with_ovl_creds(sb) \
|
||||
scoped_class(override_creds_ovl, __UNIQUE_ID(label), sb)
|
||||
|
||||
static inline const struct cred *ovl_creds(struct super_block *sb)
|
||||
{
|
||||
return OVL_FS(sb)->creator_cred;
|
||||
|
||||
Reference in New Issue
Block a user