Subject: Re: bin/2485: some kvm progs insecure
To: None <kashmir@umiacs.UMD.EDU, netbsd-bugs@NetBSD.ORG>
From: Olaf Seibert <rhialto@polder.ubc.kun.nl>
List: netbsd-bugs
Date: 06/03/1996 14:38:03
kashmir@umiacs.UMD.EDU wrote:
> +	 * Discard setgid privileges if not the running kernel so that bad
> +	 * guys can't print interesting stuff from kernel memory.
> +	 */
> +	if (system != _PATH_UNIX || kmemf != _PATH_KMEM)
> +		setgid(getgid());
> +

I doubt if a patch like this is going to work. Remember, _PATH_UNIX and
_PATH_KMEM are #defines for string literals, and different string
literals, even if they contain the same text, may or may not have
different addresses. I suggest using strcmp().

-Olaf.
--
___ Olaf 'Rhialto' Seibert      D787B44DFC896063 4CBB95A5BD1DAA96 
\X/ Ceci n'est pas un Magritte          rhialto@polder.ubc.kun.nl