Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / security / keys / proc.c
index 12b750e..686a9ee 100644 (file)
@@ -137,6 +137,13 @@ static int proc_keys_show(struct seq_file *m, void *v)
        struct timespec now;
        unsigned long timo;
        char xbuf[12];
+       int rc;
+
+       /* check whether the current task is allowed to view the key (assuming
+        * non-possession) */
+       rc = key_task_permission(make_key_ref(key, 0), current, KEY_VIEW);
+       if (rc < 0)
+               return 0;
 
        now = current_kernel_time();