Subject: Re: Process credentials change
To: Andrew Doran <>
From: Bill Studenmund <>
List: tech-kern
Date: 07/10/2006 13:39:05
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 10, 2006 at 10:50:24AM +0100, Andrew Doran wrote:
> Hi all,
> p->p_cred is one of the most widely passed about parts of the proc
> structure. For MP locking purposes, giving each LWP a reference to the
> credentials would avoid sprinkling locks all around the kernel. I want
> to:
> 1. maintain p_cred as the master copy
> 2. hold a reference to creds in each struct lwp
> 3. on syscall / user trap, update l->l_cred if (l->l_cred !=3D p->p_cred)
> 4. use the LWP creds wherever sane
> 5. make accounting flags per-LWP and collate into struct proc on LWP exit
> Any comments?

My concerns are around what's going on if l->l_cred !=3D p->p_cred. Since a=
process is supposed to have one credential state, if we ever change=20
p_cred, we REALLY need all the l_creds to change at the same time. And=20
that means a global lock.

So I don't think this'll work. I think a shared lock is all we need, so=20
hopefuly the locking can be handled quickly.

Take care,


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)