Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[linux-2.6-block.git] / security / keys / permission.c
index a72b4dd70c8abfab5d05503415c4a5fcef7b6df3..f68dc04d614e24badb3ca1058fcb023c2a54df94 100644 (file)
@@ -89,7 +89,7 @@ EXPORT_SYMBOL(key_task_permission);
 int key_validate(const struct key *key)
 {
        unsigned long flags = READ_ONCE(key->flags);
-       time_t expiry = READ_ONCE(key->expiry);
+       time64_t expiry = READ_ONCE(key->expiry);
 
        if (flags & (1 << KEY_FLAG_INVALIDATED))
                return -ENOKEY;
@@ -101,8 +101,7 @@ int key_validate(const struct key *key)
 
        /* check it hasn't expired */
        if (expiry) {
-               struct timespec now = current_kernel_time();
-               if (now.tv_sec >= expiry)
+               if (ktime_get_real_seconds() >= expiry)
                        return -EKEYEXPIRED;
        }