Subject: Re: Process credentials change
To: Andrew Doran <ad@NetBSD.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 07/10/2006 13:39:05
--RhUH2Ysw6aD5utA4
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,
>=20
> 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:
>=20
> 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
>=20
> Any comments?

My concerns are around what's going on if l->l_cred !=3D p->p_cred. Since a=
=20
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,

Bill

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFEsrrpWz+3JHUci9cRAr9AAJ0e0ZRxcVDPQWSjBVEogcQ/n4IZigCfVLmC
vDfXCL0duYmkeSF/7fzsCig=
=/Mg8
-----END PGP SIGNATURE-----

--RhUH2Ysw6aD5utA4--