X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7479B385842F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1706313089; bh=xM6mYOFEIa64Y46/5dCA8tR5JdNqPC2+QAD9rmGG02Q=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ZD57CGlbvRZ5ng/KTERNkcRjwhs89rwV2ekCJxr18ipEdnFv4qn4DL5MfQyi7X+Xg V4evj78L8KuM+8Lwv25f431ec0RS30j/jrxJ2GZ7tJ3KoIIjN/gbnP2U7Z4K9Ph417 kCZMBvVm3IaS3Fg3OYAmZc4R48PFA2OnQZiE0/+I= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A6F13858D33 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2A6F13858D33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706313028; cv=none; b=cG55DQsiZuwF6jbyRqcYFZVuafNozlZf4AlpCiYQlOwH7biz8kBDYqZ1dSlynjCmLHUFkmfjJXdBPnrkmeFo88+HVkLfevrGjjvvtQ2Cjw8ergbqAhwfYGf5j8I2BaovrKt9m1kLcVmrp4nq3KQWSmHMWwsvj0Y27wssJMlh/zM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706313028; c=relaxed/simple; bh=X6tB0U6hHGXq57zYpnvCnDtRg1jq/sLW/c8LlVqf4FA=; h=Date:From:To:Subject:Message-ID:Mime-Version; b=SlapzeXgNfP4sblvQEuSi29cqR0rRUvWjZCIUAoRIs+4LPBuJ1HH/kVX/yonh0dNJQlfU0nfMGtBWdPb3JEUwv/lFIITiTlimKXXnfz6AEspzgOKQtgjP7hzTdsgO3zfGdRY2rTTgIUZzV9AqdxZohtb+5HK+hGLHU3oqTpZv2k= ARC-Authentication-Results: i=1; server2.sourceware.org X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Spam-Language: en X-Spam-Relay-Country: X-Spam-DCC: B=www.nova53.net; R=smtp1.atof.net 1205; Body=1 Fuz1=1 Fuz2=1 X-Spam-RBL: X-Spam-PYZOR: Reported 0 times. Date: Fri, 26 Jan 2024 18:50:19 -0500 To: cygwin AT cygwin DOT com Cc: Johnothan King Subject: Re: arc4random does not reseed after using fork() Message-ID: Mime-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Glenn Strauss via Cygwin Reply-To: Glenn Strauss Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Cygwin" > 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 -- 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