From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#13768: --without-posix code uses scm_getpid() in libguile-2.0.2 Date: Sun, 24 Feb 2013 20:17:47 -0500 Message-ID: <87sj4l5gzo.fsf@tines.lan> References: <51240CE7.8030802@email.de> <87ip5hcyb1.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361755178 20064 80.91.229.3 (25 Feb 2013 01:19:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Feb 2013 01:19:38 +0000 (UTC) Cc: shookie@email.de To: 13768@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Feb 25 02:20:01 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U9mjZ-0005X1-5u for guile-bugs@m.gmane.org; Mon, 25 Feb 2013 02:20:01 +0100 Original-Received: from localhost ([::1]:43790 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9mjE-00014W-Fp for guile-bugs@m.gmane.org; Sun, 24 Feb 2013 20:19:40 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9mjA-00013m-T1 for bug-guile@gnu.org; Sun, 24 Feb 2013 20:19:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U9mj7-0001Az-RO for bug-guile@gnu.org; Sun, 24 Feb 2013 20:19:36 -0500 Original-Received: from [140.186.70.43] (port=42927 helo=debbugs.gnu.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9mj7-000180-Oq for bug-guile@gnu.org; Sun, 24 Feb 2013 20:19:33 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U9mkX-0005S8-Sj for bug-guile@gnu.org; Sun, 24 Feb 2013 20:21:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 25 Feb 2013 01:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13768 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 13768-submit@debbugs.gnu.org id=B13768.136175520220880 (code B ref 13768); Mon, 25 Feb 2013 01:21:01 +0000 Original-Received: (at 13768) by debbugs.gnu.org; 25 Feb 2013 01:20:02 +0000 Original-Received: from localhost ([127.0.0.1]:48391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U9mja-0005Qj-1L for submit@debbugs.gnu.org; Sun, 24 Feb 2013 20:20:02 -0500 Original-Received: from world.peace.net ([96.39.62.75]:57396) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U9mjE-0005Pt-Si for 13768@debbugs.gnu.org; Sun, 24 Feb 2013 20:20:00 -0500 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1U9mhY-0006AS-S8; Sun, 24 Feb 2013 20:17:57 -0500 In-Reply-To: <87ip5hcyb1.fsf@pobox.com> (Andy Wingo's message of "Sun, 24 Feb 2013 20:21:54 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6785 Archived-At: reopen 13768 thanks Andy Wingo writes: > On Wed 20 Feb 2013 00:38, Jan Schukat writes: > >> What happens is, in random.c in random_state_of_last_resort on line 668 >> scm_getpid is used to seed the random generator. So either a >> preprocessor switch or a hand constructed scm like in scm_getpid >> (scm_from_ulong(getpid())) should be used there. > > Fixed, thanks for the report. This has potential security implications. If the same program is run multiple times in the same second, then without something like a PID, there's a significant danger that two runs of the program will use the same random seed. Therefore, I think we ought to try hard to ensure that something like a PID will always be included in this seed. Perhaps 'scm_getpid' should be included even when building --without-posix. At the very least, the documentation (which currently claims that the PID is included in the random-state-of-last-resort) should be adjusted to reflect the new reality. I just took care of that. Thanks, Mark