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

From: Serge E. Hallyn
Date: Tue Aug 04 2009 - 17:01:33 EST


Quoting David Howells (dhowells@xxxxxxxxxx):
> 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

This won't require keyring->sem?

> > > + .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/