diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/key.h | 14 | ||||
-rw-r--r-- | include/linux/sched.h | 5 | ||||
-rw-r--r-- | include/linux/tracehook.h | 7 |
3 files changed, 15 insertions, 11 deletions
diff --git a/include/linux/key.h b/include/linux/key.h index 8b297b94bfb3..ad17c8f30b4c 100644 --- a/include/linux/key.h +++ b/include/linux/key.h @@ -269,23 +269,15 @@ extern struct key *request_key(struct key_type *type, const char *description, const char *callout_info); +extern struct key *request_key_rcu(struct key_type *type, + const char *description); + extern struct key *request_key_with_auxdata(struct key_type *type, const char *description, const void *callout_info, size_t callout_len, void *aux); -extern struct key *request_key_async(struct key_type *type, - const char *description, - const void *callout_info, - size_t callout_len); - -extern struct key *request_key_async_with_auxdata(struct key_type *type, - const char *description, - const void *callout_info, - size_t callout_len, - void *aux); - extern int wait_for_key_construction(struct key *key, bool intr); extern int key_validate(const struct key *key); diff --git a/include/linux/sched.h b/include/linux/sched.h index 459d95e4a574..8dc1811487f5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -892,6 +892,11 @@ struct task_struct { /* Effective (overridable) subjective task credentials (COW): */ const struct cred __rcu *cred; +#ifdef CONFIG_KEYS + /* Cached requested key. */ + struct key *cached_requested_key; +#endif + /* * executable name, excluding path. * diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index 09d678433fc0..8446573cc682 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h @@ -184,6 +184,13 @@ static inline void tracehook_notify_resume(struct pt_regs *regs) if (unlikely(current->task_works)) task_work_run(); +#ifdef CONFIG_KEYS_REQUEST_CACHE + if (unlikely(current->cached_requested_key)) { + key_put(current->cached_requested_key); + current->cached_requested_key = NULL; + } +#endif + mem_cgroup_handle_over_high(); blkcg_maybe_throttle_current(); } |