ovl: port ovl_listxattr() to cred guard

Use the scoped ovl cred guard.

Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-32-b31603935724@kernel.org
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Christian Brauner 2025-11-17 10:34:03 +01:00
parent ae64b54185
commit 0b5800172c
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2
1 changed files with 2 additions and 4 deletions

View File

@ -109,12 +109,10 @@ ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size)
ssize_t res; ssize_t res;
size_t len; size_t len;
char *s; char *s;
const struct cred *old_cred;
size_t prefix_len, name_len; size_t prefix_len, name_len;
old_cred = ovl_override_creds(dentry->d_sb); with_ovl_creds(dentry->d_sb)
res = vfs_listxattr(realdentry, list, size); res = vfs_listxattr(realdentry, list, size);
ovl_revert_creds(old_cred);
if (res <= 0 || size == 0) if (res <= 0 || size == 0)
return res; return res;