Re: [PATCH 00/59] Introduce credentials

David Howells
2008-08-28T09:20:07Z

Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> > We get a number of things:
> >
> > (1) Multiple credential changes all happen simultaneously (setresuid() for
> > example). The new set of credentials is committed with a single RCU
> > assignment.
>
> Makes sense - except for the question of bounding memory utilisation.

Would it make sense to call synchronise_rcu() from commit_creds() or from
setuid()/setresuid()/setgroups()/etc. to make sure that some user process
doing:

while (1)
alter_credentials();

doesn't run the system out of memory by having loads of frees waiting in RCU's
queues because put_cred() uses call_rcu() to defer the destruction.

David