delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/01/27/19:31:32

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF2BA3858422
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1706401892;
bh=fcDGYSkEf7j7+IIn8GPhiTiyxSmucRN3pAnmIhffM94=;
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=yfIZuXoh8A31K86BipKqdR38MFEc9pKGD5PCV6QB4v8ck3XKv8XbmPg6wwHhU5Z1t
+G9220okFzzivDbrExR1xqG11mR9UhpcGgfuFr7Z+7dRjpGCpvdeINAEyt2oFoLHOr
zs/TOUJwSKvJ5aNMD1qhmkSjblzcuoF/CtJVLVHs=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0F1FB385828F
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0F1FB385828F
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706401827; cv=none;
b=W/YacSAfkmUYBNnh1RFxP8JwVurN9+iEwImLl9GA919/VTFa//pW+irzv4I42aPWgirp41n3sS6+AHjB9hKt1MQshNer2UFGeVdn4xQMljxZE/0NRReOEnNXULmQ1ETnMuI6Qpsw3OtrdHJNqDhcqTQRYgMYWaWkBFmxOBFOptY=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1706401827; c=relaxed/simple;
bh=BhPIuNcKb3SOSBpeIbuws/Jk7SuPi6YAx5C5yYZ2mIA=;
h=Message-ID:Date:MIME-Version:From:Subject:To;
b=H4L2djsdnCgMHw1X0lHyQCXz7FoZ4qFaF9PvNhBf2MGY1o6nKV1cTYEhjxt/jCRcXw/nfq0UcJXYcOIBuMAX5ubgEynrSnNMub21AnSu8Y9250vYtSaO8R3IKyuX+GdLPOoQNYuoU3kk0wSYKL0QcMAw0vxEoqOaQ7vhXcWp7PY=
ARC-Authentication-Results: i=1; server2.sourceware.org
Message-ID: <d35ac0c5-12a7-449a-9dcd-516350056da6@SystematicSW.ab.ca>
Date: Sat, 27 Jan 2024 17:30:21 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: arc4random does not reseed after using fork()
To: cygwin AT cygwin DOT com
References: <ZbRFO6gtx0XHMZ5k AT xps13>
Organization: Systematic Software
In-Reply-To: <ZbRFO6gtx0XHMZ5k@xps13>
X-Rspamd-Queue-Id: 32DB56000A
X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,
SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE,
UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6
X-Rspamd-Server: rspamout02
X-Stat-Signature: qrdfbi7a1rjkco7atw7a6ddtgy6y6gha
X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361
X-Session-ID: U2FsdGVkX1+ouOZO7ogBNVC05+fKGEd5Czz34skVhq0=
X-HE-Tag: 1706401821-901871
X-HE-Meta: U2FsdGVkX18MWW7OwWraFrIACyIW3sEyzwxnI6uXJtT4bT3+9sWhKsmcl9vnIkYxV224L1VBUL0vGT7lkbYRxIvSdel+nn1n6v9I2IKkWGRBMAhDkKFc4iQPHlLvMd0ehRAWVwO747lTDDnG6u/QywKF2uysMqLScjbKjdpbW3KXComhOisGNL+aMZsr9Ri+NGsERdw5Z9J2wRcmEHzYnG+ei1Rk8llO3JCq0zOOf1ulle2bdtNlW0mWaSKcVf4XsHNFIBV6x1Iant2KMWvmQx9cVSqSO0Kne1uz4I7/G1tIPITWKBND2gZbdWhq2/MKGcLeuXw35ovnUHnWbAGWcS+7wt/knGOCw6He0i5bmzpU+7k7R6XXtUtRm6sqo1tMNxBGGQYG4zORArvcsikod8KIkzq25QcSq4XnVCm69meqqQ8xZ1v9lrnNuklinOiLNHPUQRexE1M=
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Brian Inglis via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT ab DOT ca>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 40S0VW51030141

On 2024-01-26 16:50, Glenn Strauss via Cygwin wrote:
>> While testing ksh93u+m's recently added SRANDOM variable[1], I have
>> discovered a bug in Cygwin's arc4random function. After using fork(),
>> arc4random does not reseed itself, which causes the results to become
>> predictable[2]. Below is a test case C program exhibiting the bug:
>> ...
>> [1]: https://github.com/ksh93/ksh/commit/00b296c
>> [2]: https://github.com/ksh93/ksh/issues/711

> FYI: There was a thread in Nov 2023 about rand() which might be related.
> rand is not ISO C compliant in Cygwin
> https://cygwin.com/pipermail/cygwin/2023-November/254735.html
> conclusion of that thread:
> https://cygwin.com/pipermail/cygwin/2023-November/254764.html

No newlib man page or libc info but is in man-pages-linux.
Note that arc4random.c appears to be straight from OpenBSD but arc4random.h 
appears to be newlib, so could function docs be added into arc4random.h, perhaps 
based on OpenBSD man page?

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                  -- Antoine de Saint-Exupéry


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019