Date: Sun, 4 Feb 2001 19:14:14 -0500 (EST) From: Robert Watson <rwatson@FreeBSD.org> To: freebsd-arch@FreeBSD.org Subject: Tests for NULL p_ucred under p_cred -- are they needed? Message-ID: <Pine.NEB.3.96L.1010204190927.74962D-100000@fledge.watson.org>
next in thread | raw e-mail | index | archive | help
I've noticed that at various points in the kernel code, there are tests to check that the ucred structure in a proc is non-NULL before using it. Under what circumstances do we believe it is possible for the ucred pointer to be non-NULL? It seems that, in normal usage, it should always be defined--the only points where it might be NULL would be during process creation and process exit. Are these windows long enough for it to be a concern? Are appropriate process locks held, under SMPng, such that it's never possible to grab a ucred structure for a process while it is NULL? It seems that there are other components of the code that assume that if (p) is non-NULL, then a ucred must be defined for the process, which seems like a consistent assumption assuming appropriate protections are in place. Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1010204190927.74962D-100000>