*/
static DECLARE_RWSEM(keyring_serialise_link_sem);
-/*****************************************************************************/
/*
* publish the name of a keyring so that it can be found by name (if it has
* one)
write_unlock(&keyring_name_lock);
}
+}
-} /* end keyring_publish_name() */
-
-/*****************************************************************************/
/*
* initialise a keyring
* - we object if we were given any data
}
return ret;
+}
-} /* end keyring_instantiate() */
-
-/*****************************************************************************/
/*
* match keyrings on their name
*/
{
return keyring->description &&
strcmp(keyring->description, description) == 0;
+}
-} /* end keyring_match() */
-
-/*****************************************************************************/
/*
* dispose of the data dangling from the corpse of a keyring
*/
key_put(klist->keys[loop]);
kfree(klist);
}
+}
-} /* end keyring_destroy() */
-
-/*****************************************************************************/
/*
* describe the keyring
*/
else
seq_puts(m, ": empty");
rcu_read_unlock();
+}
-} /* end keyring_describe() */
-
-/*****************************************************************************/
/*
* read a list of key IDs from the keyring's contents
* - the keyring's semaphore is read-locked
error:
return ret;
+}
-} /* end keyring_read() */
-
-/*****************************************************************************/
/*
* allocate a keyring and link into the destination keyring
*/
}
return keyring;
+}
-} /* end keyring_alloc() */
-
-/*****************************************************************************/
/*
* search the supplied keyring tree for a key that matches the criterion
* - perform a breadth-then-depth search up to the prescribed limit
rcu_read_unlock();
error:
return key_ref;
+}
-} /* end keyring_search_aux() */
-
-/*****************************************************************************/
/*
* search the supplied keyring tree for a key that matches the criterion
* - perform a breadth-then-depth search up to the prescribed limit
return keyring_search_aux(keyring, current->cred,
type, description, type->match);
-
-} /* end keyring_search() */
+}
EXPORT_SYMBOL(keyring_search);
-/*****************************************************************************/
/*
* search the given keyring only (no recursion)
* - keyring must be locked by caller
atomic_inc(&key->usage);
rcu_read_unlock();
return make_key_ref(key, possessed);
+}
-} /* end __keyring_search_one() */
-
-/*****************************************************************************/
/*
* find a keyring with the specified name
* - all named keyrings are searched
out:
read_unlock(&keyring_name_lock);
return keyring;
+}
-} /* end find_keyring_by_name() */
-
-/*****************************************************************************/
/*
* see if a cycle will will be created by inserting acyclic tree B in acyclic
* tree A at the topmost level (ie: as a direct child of A)
cycle_detected:
ret = -EDEADLK;
goto error;
-
-} /* end keyring_detect_cycle() */
+}
/*
* dispose of a keyring list after the RCU grace period, freeing the unlinked
EXPORT_SYMBOL(key_link);
-/*****************************************************************************/
/*
* unlink the first link to a key from a keyring
*/
ret = -ENOMEM;
up_write(&keyring->sem);
goto error;
-
-} /* end key_unlink() */
+}
EXPORT_SYMBOL(key_unlink);
-/*****************************************************************************/
/*
* dispose of a keyring list after the RCU grace period, releasing the keys it
* links to
key_put(klist->keys[loop]);
kfree(klist);
+}
-} /* end keyring_clear_rcu_disposal() */
-
-/*****************************************************************************/
/*
* clear the specified process keyring
* - implements keyctl(KEYCTL_CLEAR)
}
return ret;
-
-} /* end keyring_clear() */
+}
EXPORT_SYMBOL(keyring_clear);
-/*****************************************************************************/
/*
* dispose of the links from a revoked keyring
* - called with the key sem write-locked
rcu_assign_pointer(keyring->payload.subscriptions, NULL);
call_rcu(&klist->rcu, keyring_clear_rcu_disposal);
}
-
-} /* end keyring_revoke() */
+}
/*
* Determine whether a key is dead