GNU bug report logs -
#13768
--without-posix code uses scm_getpid() in libguile-2.0.2
Previous Next
Reported by: Jan Schukat <shookie <at> email.de>
Date: Tue, 19 Feb 2013 23:42:01 UTC
Severity: normal
Done: Mark H Weaver <mhw <at> netris.org>
Bug is archived. No further changes may be made.
Full log
Message #13 received at 13768 <at> debbugs.gnu.org (full text, mbox):
reopen 13768
thanks
Andy Wingo <wingo <at> pobox.com> writes:
> On Wed 20 Feb 2013 00:38, Jan Schukat <shookie <at> email.de> 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
This bug report was last modified 12 years and 91 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.