From owner-freebsd-security Thu Jul 12 12:51:24 2001 Delivered-To: freebsd-security@freebsd.org Received: from obsecurity.dyndns.org (adsl-63-207-60-73.dsl.lsan03.pacbell.net [63.207.60.73]) by hub.freebsd.org (Postfix) with ESMTP id DE3EB37B405 for ; Thu, 12 Jul 2001 12:51:19 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 7692F66BA6; Thu, 12 Jul 2001 12:51:18 -0700 (PDT) Date: Thu, 12 Jul 2001 12:51:18 -0700 From: Kris Kennaway To: rich@rdrose.org Cc: Peter Pentchev , freebsd-security@FreeBSD.ORG Subject: Re: kern.randompid Message-ID: <20010712125117.A6782@xor.obsecurity.org> References: <20010712183721.B849@ringworld.oblivion.bg> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="PEIAKu/WMn1b1Hv9" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from rich@rdrose.org on Thu, Jul 12, 2001 at 08:24:28PM +0100 Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 12, 2001 at 08:24:28PM +0100, rich@rdrose.org wrote: > On Thu, 12 Jul 2001, Peter Pentchev wrote: > > The kern.randompid sysctl is not a boolean flag, but an estimate > > of the random value that will be added to each newly created pid. >=20 > Oh. That would make much more sense as to why it's not working. Having > been using OpenBSD though (where the pids can be anything between about 30 > and 32760), just adding a random amount between 1 and kern.randompid seems > not very random really. Please do correct me if this is wrong. It's a slight generalization of the algorithm which OpenBSD use (they use a hard-wired maximum value for the random PID skip). If you set the sysctl to whatever value they use, it works identically. > The comments in the code say "Using a modulus that is too big causes a LOT > more process table scans". What is "too big"? I had a quick peer at > kern_fork.c, and pidchecked is mentioned a lot, but nothing lept out at me > saying "which would make too big". I believe the comment means "the larger the number the more work the kernel needs to do to generate each new process ID" Kris --PEIAKu/WMn1b1Hv9 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 iD8DBQE7Tf+0Wry0BWjoQKURAu6QAKCQMyRL9tYI3lZBNVurMfAnBm1kQACcC01O uDbz9vnNc9ZQQtONYQII7jI= =b2qX -----END PGP SIGNATURE----- --PEIAKu/WMn1b1Hv9-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message