Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Aug 2002 20:29:52 +0200
From:      "Michal F. Hanula" <frankie@kyblik.pieskovisko.sk>
To:        questions@freebsd.org
Subject:   Re: randompid sysctl value
Message-ID:  <20020810182952.GA98112@kyblik.pieskovisko.sk>
In-Reply-To: <200208092201.g79M1JaD071133@node1.cluster.srrc.usda.gov>
References:  <200208092139.g79Ld7bk070861@node1.cluster.srrc.usda.gov> <20020809215532.GZ49844@vectors.cx> <200208092201.g79M1JaD071133@node1.cluster.srrc.usda.gov>

next in thread | previous in thread | raw e-mail | index | archive | help

--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 09, 2002 at 05:01:19PM -0500, Glenn Johnson wrote:
> On Fri, Aug 09, 2002 at 02:55:32PM -0700, Adam Weinberger wrote:
>=20
> > echo kern.randompid=3D1 >> /etc/sysctl.conf
> >
> > man 5 sysctl.conf
>=20
> I realized after I sent my mail that I did not provide all of the
> information.  I tried setting the value in /etc/sysctl.conf; that did
> not work.  I then set the value in /boot/loader.conf; that did not work
> either. The value is still set to 0 after rebooting.
>=20
> > >> (08.09.2002 @ 1439 PST): Glenn Johnson said, in 0.3K: <<
> > >
> > > How can I turn on the kern.randompid sysctl variable?
src/sys/kern/kern_fork.c:
        nextpid++;
	if (randompid)
	        nextpid +=3D arc4random() % randompid;

The pid assigned to a new process is chosen from the interval [last pid;
last pid + kern.randompid]. Setting kern.randompid to 1 means that the
new pid will always be the last pid + 1, which is clearly not what we
want.
(This has been discussed on -security recently, IIRC)
						m&f

--=20
The danger from computers is not that they will eventually get
as smart as men but that we will meanwhile agree to meet
them halfway.

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE9VVufQgEMP0l2aH4RAnDQAJ9P5KdJVhcl4qYHlanp3CCpC2Y/LwCgryot
yKsG3Yr8195CozleHCUIPuc=
=VTZb
-----END PGP SIGNATURE-----

--T4sUOijqQbZv57TR--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020810182952.GA98112>