mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
keys: sparse: Fix key_fs[ug]id_changed()
Sparse warnings are incurred by key_fs[ug]id_changed() due to unprotected accesses of tsk->cred, which is marked __rcu. Fix this by passing the new cred struct to these functions from commit_creds() rather than the task pointer. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: James Morris <jamorris@linux.microsoft.com>
This commit is contained in:
@@ -455,9 +455,9 @@ int commit_creds(struct cred *new)
|
||||
|
||||
/* alter the thread keyring */
|
||||
if (!uid_eq(new->fsuid, old->fsuid))
|
||||
key_fsuid_changed(task);
|
||||
key_fsuid_changed(new);
|
||||
if (!gid_eq(new->fsgid, old->fsgid))
|
||||
key_fsgid_changed(task);
|
||||
key_fsgid_changed(new);
|
||||
|
||||
/* do it
|
||||
* RLIMIT_NPROC limits on user->processes have already been checked
|
||||
|
Reference in New Issue
Block a user