mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
security: Add a cred_getsecid hook
For IMA purposes, we want to be able to obtain the prepared secid in the bprm structure before the credentials are committed. Add a cred_getsecid hook that makes this possible. Signed-off-by: Matthew Garrett <mjg59@google.com> Acked-by: Paul Moore <paul@paul-moore.com> Cc: Paul Moore <paul@paul-moore.com> Cc: Stephen Smalley <sds@tycho.nsa.gov> Cc: Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
This commit is contained in:
parent
5893ed18a2
commit
3ec3011326
5 changed files with 38 additions and 0 deletions
|
@ -1005,6 +1005,13 @@ void security_transfer_creds(struct cred *new, const struct cred *old)
|
|||
call_void_hook(cred_transfer, new, old);
|
||||
}
|
||||
|
||||
void security_cred_getsecid(const struct cred *c, u32 *secid)
|
||||
{
|
||||
*secid = 0;
|
||||
call_void_hook(cred_getsecid, c, secid);
|
||||
}
|
||||
EXPORT_SYMBOL(security_cred_getsecid);
|
||||
|
||||
int security_kernel_act_as(struct cred *new, u32 secid)
|
||||
{
|
||||
return call_int_hook(kernel_act_as, 0, new, secid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue