}
 
        /* allocate a new key */
-       key = key_alloc(ktype, description, current->fsuid, current->fsgid,
+       key = key_alloc(ktype, description, current_fsuid(), current_fsgid(),
                        current, perm, flags);
        if (IS_ERR(key)) {
                key_ref = ERR_CAST(key);
 
        /* allocate a new session keyring */
        sprintf(desc, "_req.%u", key->serial);
 
-       keyring = keyring_alloc(desc, current->fsuid, current->fsgid, current,
+       keyring = keyring_alloc(desc, current_fsuid(), current_fsgid(), current,
                                KEY_ALLOC_QUOTA_OVERRUN, NULL);
        if (IS_ERR(keyring)) {
                ret = PTR_ERR(keyring);
                goto error_link;
 
        /* record the UID and GID */
-       sprintf(uid_str, "%d", current->fsuid);
-       sprintf(gid_str, "%d", current->fsgid);
+       sprintf(uid_str, "%d", current_fsuid());
+       sprintf(gid_str, "%d", current_fsgid());
 
        /* we say which key is under construction */
        sprintf(key_str, "%d", key->serial);
        mutex_lock(&user->cons_lock);
 
        key = key_alloc(type, description,
-                       current->fsuid, current->fsgid, current, KEY_POS_ALL,
+                       current_fsuid(), current_fsgid(), current, KEY_POS_ALL,
                        flags);
        if (IS_ERR(key))
                goto alloc_failed;
        struct key *key;
        int ret;
 
-       user = key_user_lookup(current->fsuid);
+       user = key_user_lookup(current_fsuid());
        if (!user)
                return ERR_PTR(-ENOMEM);
 
 
        sprintf(desc, "%x", target->serial);
 
        authkey = key_alloc(&key_type_request_key_auth, desc,
-                           current->fsuid, current->fsgid, current,
+                           current_fsuid(), current_fsgid(), current,
                            KEY_POS_VIEW | KEY_POS_READ | KEY_POS_SEARCH |
                            KEY_USR_VIEW, KEY_ALLOC_NOT_IN_QUOTA);
        if (IS_ERR(authkey)) {