Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286078
b: refs/heads/master
c: ee0b31a
h: refs/heads/master
v: v3
  • Loading branch information
Mimi Zohar authored and James Morris committed Jan 17, 2012
1 parent 7b50713 commit 512a128
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: efde8b6e16f11e7d1681c68d86c7fd51053cada7
refs/heads/master: ee0b31a25a010116f44fca6c96f4516d417793dd
3 changes: 3 additions & 0 deletions trunk/include/linux/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ static inline bool key_is_instantiated(const struct key *key)
(rcu_dereference_protected((KEY)->payload.rcudata, \
rwsem_is_locked(&((struct key *)(KEY))->sem)))

#define rcu_assign_keypointer(KEY, PAYLOAD) \
(rcu_assign_pointer((KEY)->payload.rcudata, PAYLOAD))

#ifdef CONFIG_SYSCTL
extern ctl_table key_sysctls[];
#endif
Expand Down
4 changes: 2 additions & 2 deletions trunk/security/keys/encrypted-keys/encrypted.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ static int encrypted_instantiate(struct key *key, const void *data,
goto out;
}

rcu_assign_pointer(key->payload.data, epayload);
rcu_assign_keypointer(key, epayload);
out:
kfree(datablob);
return ret;
Expand Down Expand Up @@ -874,7 +874,7 @@ static int encrypted_update(struct key *key, const void *data, size_t datalen)
memcpy(new_epayload->payload_data, epayload->payload_data,
epayload->payload_datalen);

rcu_assign_pointer(key->payload.data, new_epayload);
rcu_assign_keypointer(key, new_epayload);
call_rcu(&epayload->rcu, encrypted_rcu_free);
out:
kfree(buf);
Expand Down
2 changes: 2 additions & 0 deletions trunk/security/keys/encrypted-keys/masterkey_trusted.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <linux/module.h>
#include <linux/err.h>
#include <keys/trusted-type.h>
#include <keys/encrypted-type.h>
#include "encrypted.h"

/*
* request_trusted_key - request the trusted key
Expand Down
4 changes: 2 additions & 2 deletions trunk/security/keys/trusted.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ static int trusted_instantiate(struct key *key, const void *data,
kfree(datablob);
kfree(options);
if (!ret)
rcu_assign_pointer(key->payload.data, payload);
rcu_assign_keypointer(key, payload);
else
kfree(payload);
return ret;
Expand Down Expand Up @@ -1067,7 +1067,7 @@ static int trusted_update(struct key *key, const void *data, size_t datalen)
goto out;
}
}
rcu_assign_pointer(key->payload.data, new_p);
rcu_assign_keypointer(key, new_p);
call_rcu(&p->rcu, trusted_rcu_free);
out:
kfree(datablob);
Expand Down

0 comments on commit 512a128

Please sign in to comment.