1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-22 07:53:11 -05:00

tree-wide: s/override_creds_light()/override_creds()/g

Rename all calls to override_creds_light() back to overrid_creds().

Link: https://lore.kernel.org/r/20241125-work-cred-v2-5-68b9d38bb5b2@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Christian Brauner 2024-11-25 15:10:01 +01:00
parent a51a1d6bca
commit 6771e004b4
No known key found for this signature in database
GPG key ID: 91C61BC06578DCA2
27 changed files with 33 additions and 33 deletions

View file

@ -911,7 +911,7 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
ret = -ENOMEM;
goto out;
}
old_cred = override_creds_light(get_new_cred(kern_cred));
old_cred = override_creds(get_new_cred(kern_cred));
ret = fw_get_filesystem_firmware(device, fw->priv, "", NULL);

View file

@ -244,7 +244,7 @@ static struct file *open_file_as_root(const char *filename, int flags, umode_t m
if (!cred)
return ERR_PTR(-ENOMEM);
cred->fsuid = GLOBAL_ROOT_UID;
old_cred = override_creds_light(get_new_cred(cred));
old_cred = override_creds(get_new_cred(cred));
fp = file_open_root(&root, filename, flags, mode);
path_put(&root);

View file

@ -3756,7 +3756,7 @@ static int __init target_core_init_configfs(void)
ret = -ENOMEM;
goto out;
}
old_cred = override_creds_light(get_new_cred(kern_cred));
old_cred = override_creds(get_new_cred(kern_cred));
target_init_dbroot();
put_cred(revert_creds_light(old_cred));
put_cred(kern_cred);

View file

@ -1639,7 +1639,7 @@ static int aio_write(struct kiocb *req, const struct iocb *iocb,
static void aio_fsync_work(struct work_struct *work)
{
struct aio_kiocb *iocb = container_of(work, struct aio_kiocb, fsync.work);
const struct cred *old_cred = override_creds_light(get_new_cred(iocb->fsync.creds));
const struct cred *old_cred = override_creds(get_new_cred(iocb->fsync.creds));
iocb->ki_res.res = vfs_fsync(iocb->fsync.file, iocb->fsync.datasync);
put_cred(revert_creds_light(old_cred));

View file

@ -176,7 +176,7 @@ ssize_t backing_file_read_iter(struct file *file, struct iov_iter *iter,
!(file->f_mode & FMODE_CAN_ODIRECT))
return -EINVAL;
old_cred = override_creds_light(ctx->cred);
old_cred = override_creds(ctx->cred);
if (is_sync_kiocb(iocb)) {
rwf_t rwf = iocb_to_rw_flags(flags);
@ -233,7 +233,7 @@ ssize_t backing_file_write_iter(struct file *file, struct iov_iter *iter,
*/
flags &= ~IOCB_DIO_CALLER_COMP;
old_cred = override_creds_light(ctx->cred);
old_cred = override_creds(ctx->cred);
if (is_sync_kiocb(iocb)) {
rwf_t rwf = iocb_to_rw_flags(flags);
@ -281,7 +281,7 @@ ssize_t backing_file_splice_read(struct file *in, struct kiocb *iocb,
if (WARN_ON_ONCE(!(in->f_mode & FMODE_BACKING)))
return -EIO;
old_cred = override_creds_light(ctx->cred);
old_cred = override_creds(ctx->cred);
ret = vfs_splice_read(in, &iocb->ki_pos, pipe, len, flags);
revert_creds_light(old_cred);
@ -310,7 +310,7 @@ ssize_t backing_file_splice_write(struct pipe_inode_info *pipe,
if (ret)
return ret;
old_cred = override_creds_light(ctx->cred);
old_cred = override_creds(ctx->cred);
file_start_write(out);
ret = out->f_op->splice_write(pipe, out, &iocb->ki_pos, len, flags);
file_end_write(out);
@ -338,7 +338,7 @@ int backing_file_mmap(struct file *file, struct vm_area_struct *vma,
vma_set_file(vma, file);
old_cred = override_creds_light(ctx->cred);
old_cred = override_creds(ctx->cred);
ret = call_mmap(vma->vm_file, vma);
revert_creds_light(old_cred);

View file

@ -829,7 +829,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer,
* didn't matter much as only a privileged process could open
* the register file.
*/
old_cred = override_creds_light(get_new_cred(file->f_cred));
old_cred = override_creds(get_new_cred(file->f_cred));
f = open_exec(e->interpreter);
put_cred(revert_creds_light(old_cred));
if (IS_ERR(f)) {

View file

@ -393,7 +393,7 @@ extern int cachefiles_determine_cache_security(struct cachefiles_cache *cache,
static inline void cachefiles_begin_secure(struct cachefiles_cache *cache,
const struct cred **_saved_cred)
{
*_saved_cred = override_creds_light(get_new_cred(cache->cache_cred));
*_saved_cred = override_creds(get_new_cred(cache->cache_cred));
}
static inline void cachefiles_end_secure(struct cachefiles_cache *cache,

View file

@ -576,7 +576,7 @@ void do_coredump(const kernel_siginfo_t *siginfo)
if (retval < 0)
goto fail_creds;
old_cred = override_creds_light(get_new_cred(cred));
old_cred = override_creds(get_new_cred(cred));
ispipe = format_corename(&cn, &cprm, &argv, &argc);

View file

@ -374,7 +374,7 @@ static void nfs_local_call_read(struct work_struct *work)
struct iov_iter iter;
ssize_t status;
save_cred = override_creds_light(get_new_cred(filp->f_cred));
save_cred = override_creds(get_new_cred(filp->f_cred));
nfs_local_iter_init(&iter, iocb, READ);
@ -545,7 +545,7 @@ static void nfs_local_call_write(struct work_struct *work)
ssize_t status;
current->flags |= PF_LOCAL_THROTTLE | PF_MEMALLOC_NOIO;
save_cred = override_creds_light(get_new_cred(filp->f_cred));
save_cred = override_creds(get_new_cred(filp->f_cred));
nfs_local_iter_init(&iter, iocb, WRITE);

View file

@ -311,7 +311,7 @@ static ssize_t nfs_idmap_get_key(const char *name, size_t namelen,
const struct user_key_payload *payload;
ssize_t ret;
saved_cred = override_creds_light(get_new_cred(id_resolver_cache));
saved_cred = override_creds(get_new_cred(id_resolver_cache));
rkey = nfs_idmap_request_key(name, namelen, type, idmap);
put_cred(revert_creds_light(saved_cred));

View file

@ -79,7 +79,7 @@ int nfsd_setuser(struct svc_cred *cred, struct svc_export *exp)
else
new->cap_effective = cap_raise_nfsd_set(new->cap_effective,
new->cap_permitted);
put_cred(override_creds_light(get_new_cred(new)));
put_cred(override_creds(get_new_cred(new)));
put_cred(new);
return 0;

View file

@ -81,7 +81,7 @@ nfs4_save_creds(const struct cred **original_creds)
new->fsuid = GLOBAL_ROOT_UID;
new->fsgid = GLOBAL_ROOT_GID;
*original_creds = override_creds_light(get_new_cred(new));
*original_creds = override_creds(get_new_cred(new));
put_cred(new);
return 0;
}

View file

@ -221,7 +221,7 @@ static __be32 nfsd_set_fh_dentry(struct svc_rqst *rqstp, struct net *net,
new->cap_effective =
cap_raise_nfsd_set(new->cap_effective,
new->cap_permitted);
put_cred(override_creds_light(get_new_cred(new)));
put_cred(override_creds(get_new_cred(new)));
put_cred(new);
} else {
error = nfsd_setuser_and_check_port(rqstp, cred, exp);

View file

@ -448,7 +448,7 @@ static const struct cred *access_override_creds(void)
*/
override_cred->non_rcu = 1;
old_cred = override_creds_light(get_new_cred(override_cred));
old_cred = override_creds(get_new_cred(override_cred));
/* override_cred() gets its own ref */
put_cred(override_cred);

View file

@ -741,7 +741,7 @@ static int ovl_prep_cu_creds(struct dentry *dentry, struct ovl_cu_creds *cc)
return err;
if (cc->new)
cc->old = override_creds_light(get_new_cred(cc->new));
cc->old = override_creds(get_new_cred(cc->new));
return 0;
}

View file

@ -580,7 +580,7 @@ static const struct cred *ovl_setup_cred_for_create(struct dentry *dentry,
* We must be called with creator creds already, otherwise we risk
* leaking creds.
*/
old_cred = override_creds_light(override_cred);
old_cred = override_creds(override_cred);
WARN_ON_ONCE(old_cred != ovl_creds(dentry->d_sb));
return override_cred;

View file

@ -65,7 +65,7 @@ const struct cred *ovl_override_creds(struct super_block *sb)
{
struct ovl_fs *ofs = OVL_FS(sb);
return override_creds_light(ofs->creator_cred);
return override_creds(ofs->creator_cred);
}
void ovl_revert_creds(const struct cred *old_cred)

View file

@ -173,7 +173,7 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo,
}
cifs_dbg(FYI, "key description = %s\n", description);
saved_cred = override_creds_light(get_new_cred(spnego_cred));
saved_cred = override_creds(get_new_cred(spnego_cred));
spnego_key = request_key(&cifs_spnego_key_type, description, "");
put_cred(revert_creds_light(saved_cred));

View file

@ -292,7 +292,7 @@ id_to_sid(unsigned int cid, uint sidtype, struct smb_sid *ssid)
return -EINVAL;
rc = 0;
saved_cred = override_creds_light(get_new_cred(root_cred));
saved_cred = override_creds(get_new_cred(root_cred));
sidkey = request_key(&cifs_idmap_key_type, desc, "");
if (IS_ERR(sidkey)) {
rc = -EINVAL;
@ -398,7 +398,7 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct smb_sid *psid,
if (!sidstr)
return -ENOMEM;
saved_cred = override_creds_light(get_new_cred(root_cred));
saved_cred = override_creds(get_new_cred(root_cred));
sidkey = request_key(&cifs_idmap_key_type, sidstr, "");
if (IS_ERR(sidkey)) {
cifs_dbg(FYI, "%s: Can't map SID %s to a %cid\n",

View file

@ -780,7 +780,7 @@ int __ksmbd_override_fsids(struct ksmbd_work *work,
cred->cap_effective = cap_drop_fs_set(cred->cap_effective);
WARN_ON(work->saved_cred);
work->saved_cred = override_creds_light(get_new_cred(cred));
work->saved_cred = override_creds(get_new_cred(cred));
if (!work->saved_cred) {
abort_creds(cred);
return -EINVAL;

View file

@ -170,7 +170,7 @@ static inline bool cap_ambient_invariant_ok(const struct cred *cred)
cred->cap_inheritable));
}
static inline const struct cred *override_creds_light(const struct cred *override_cred)
static inline const struct cred *override_creds(const struct cred *override_cred)
{
const struct cred *old = current->cred;

View file

@ -1728,7 +1728,7 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
return -EBADF;
if (unlikely((req->flags & REQ_F_CREDS) && req->creds != current_cred()))
creds = override_creds_light(get_new_cred(req->creds));
creds = override_creds(get_new_cred(req->creds));
if (!def->audit_skip)
audit_uring_entry(req->opcode);

View file

@ -174,7 +174,7 @@ static int __io_sq_thread(struct io_ring_ctx *ctx, bool cap_entries)
const struct cred *creds = NULL;
if (ctx->sq_creds != current_cred())
creds = override_creds_light(get_new_cred(ctx->sq_creds));
creds = override_creds(get_new_cred(ctx->sq_creds));
mutex_lock(&ctx->uring_lock);
if (!wq_list_empty(&ctx->iopoll_list))

View file

@ -501,7 +501,7 @@ static void do_acct_process(struct bsd_acct_struct *acct)
flim = rlimit(RLIMIT_FSIZE);
current->signal->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
/* Perform file operations on behalf of whoever enabled accounting */
orig_cred = override_creds_light(get_new_cred(file->f_cred));
orig_cred = override_creds(get_new_cred(file->f_cred));
/*
* First check to see if there is enough free_space to continue

View file

@ -5216,7 +5216,7 @@ static ssize_t __cgroup_procs_write(struct kernfs_open_file *of, char *buf,
* permissions using the credentials from file open to protect against
* inherited fd attacks.
*/
saved_cred = override_creds_light(get_new_cred(of->file->f_cred));
saved_cred = override_creds(get_new_cred(of->file->f_cred));
ret = cgroup_attach_permissions(src_cgrp, dst_cgrp,
of->file->f_path.dentry->d_sb,
threadgroup, ctx->ns);

View file

@ -1469,7 +1469,7 @@ static int user_event_set_call_visible(struct user_event *user, bool visible)
*/
cred->fsuid = GLOBAL_ROOT_UID;
old_cred = override_creds_light(get_new_cred(cred));
old_cred = override_creds(get_new_cred(cred));
if (visible)
ret = trace_add_event_call(&user->call);

View file

@ -124,7 +124,7 @@ int dns_query(struct net *net,
/* make the upcall, using special credentials to prevent the use of
* add_key() to preinstall malicious redirections
*/
saved_cred = override_creds_light(get_new_cred(dns_resolver_cache));
saved_cred = override_creds(get_new_cred(dns_resolver_cache));
rkey = request_key_net(&key_type_dns_resolver, desc, net, options);
put_cred(revert_creds_light(saved_cred));
kfree(desc);