Merge tag 'keys-request-20190626' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-rpi.git] / security / keys / Kconfig
index ee502e4..dd31343 100644 (file)
@@ -25,6 +25,24 @@ config KEYS_COMPAT
        def_bool y
        depends on COMPAT && KEYS
 
+config KEYS_REQUEST_CACHE
+       bool "Enable temporary caching of the last request_key() result"
+       depends on KEYS
+       help
+         This option causes the result of the last successful request_key()
+         call that didn't upcall to the kernel to be cached temporarily in the
+         task_struct.  The cache is cleared by exit and just prior to the
+         resumption of userspace.
+
+         This allows the key used for multiple step processes where each step
+         wants to request a key that is likely the same as the one requested
+         by the last step to save on the searching.
+
+         An example of such a process is a pathwalk through a network
+         filesystem in which each method needs to request an authentication
+         key.  Pathwalk will call multiple methods for each dentry traversed
+         (permission, d_revalidate, lookup, getxattr, getacl, ...).
+
 config PERSISTENT_KEYRINGS
        bool "Enable register of persistent per-UID keyrings"
        depends on KEYS