X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=security%2Fkeys%2Fproc.c;fp=security%2Fkeys%2Fproc.c;h=686a9ee0c5dee8b43fbcf72e407dc386e52e7086;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=12b750e51fbf5c133ca4877b13a184081b73e652;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/security/keys/proc.c b/security/keys/proc.c index 12b750e51..686a9ee0c 100644 --- a/security/keys/proc.c +++ b/security/keys/proc.c @@ -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();