Re: [PATCH 4/6] KEYS: Add garbage collection for dead, revoked and expired keys.

From: David Howells
Date: Tue Aug 04 2009 - 16:31:45 EST


Serge E. Hallyn <serue@xxxxxxxxxx> wrote:

> These two lines (repeated below) beg for a helper?

Yeah... Seems reasonable.

> Can this happen? This implies that the number of live keys
> went up, but we're under keyring->sem?

An expired key can be updated back to life:

[root@andromeda ~]# keyctl add user a a @s
619170185
[root@andromeda ~]# keyctl timeout 619170185 5
[root@andromeda ~]# keyctl show
Session Keyring
-3 --alswrv 0 0 keyring: _ses
627083299 --alswrv 0 -1 \_ keyring: _uid.0
619170185 --alswrv 0 0 \_ user: a
[root@andromeda ~]# keyctl show
Session Keyring
-3 --alswrv 0 0 keyring: _ses
627083299 --alswrv 0 -1 \_ keyring: _uid.0
619170185: key inaccessible (Key has expired)
[root@andromeda ~]# keyctl add user a a @s
619170185
[root@andromeda ~]# keyctl show
Session Keyring
-3 --alswrv 0 0 keyring: _ses
627083299 --alswrv 0 -1 \_ keyring: _uid.0
619170185 --alswrv 0 0 \_ user: a

> > + .data = &key_gc_delay,
>
> I see where this variable is defined at top of the patch, but
> I don't see where it is actually used?

Bah! I forgot to add gc.c to the mix. Sorry about that.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/