From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by sourceware.org (Postfix) with ESMTPS id E9A153858409 for ; Wed, 28 Dec 2022 21:04:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E9A153858409 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=opensuse.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cristianrodriguez.net Received: by mail-io1-f54.google.com with SMTP id h6so8822253iof.9 for ; Wed, 28 Dec 2022 13:04:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xEiLc7tj1Ul5XY+PCVdXES8JC+ZkwZKd5l2EQZIfqG0=; b=MVoZJKcWEu0Ke8zYZI4o1jCamrCMk6iq8X+Enucse70Ha52fIxEM/zfLTW9M+ablCW IcZZzt7j9DMcGa9CdD4pD+49xatZl6/ByZ4qd6Z5XjRe7oTdxKb9l1lMoplxWY8EJBuj guj+yrO4x4R4oYjAf4aKjdcMr0AySuCleaKK0CC4qmPj/6n0eAVIOFrM63JPpcYBQWkH icYqyHcfaGga8425Mv+YnKSKHICFQLsnRPK4JnvW1HyuigncqZSlxcGm48/CUdhmxWRJ bszZq7f6y42r/f7tAg2UnlV23d3C8IsbCjnlVK5Q47xtkbt6oW/JdRF8tlAhFs0bJo66 KmZQ== X-Gm-Message-State: AFqh2kpKmb4Kq0JfD6VTrXMAFyrycMdRsfEUheB8Mx+LDb/F8MgYAxkj tcX5xRdyePEQj9Md1ea//fJ+UB947CrBBtVv4tdlbQ== X-Google-Smtp-Source: AMrXdXuGdyxS1SPzsaTSonFj1YxmoyeVWft92lmJaN4LjAO/mj8Cth1EmdEgHBWvRX6nVilHcQd1uhmJo53pH6KuFGQ= X-Received: by 2002:a05:6638:4609:b0:38a:849d:a479 with SMTP id bw9-20020a056638460900b0038a849da479mr2479740jab.6.1672261490074; Wed, 28 Dec 2022 13:04:50 -0800 (PST) MIME-Version: 1.0 References: <105835f5-359c-2646-f609-e73459ee2d3b@jguk.org> <92e5ad68-d013-43f5-cc3e-459daea93a83@gmail.com> <589afb02-2a34-7ad8-62cb-94bccc13033e@jguk.org> <3af45047-1d30-c4e8-cb73-a70eed6927fe@gmail.com> In-Reply-To: From: =?UTF-8?Q?Cristian_Rodr=C3=ADguez?= Date: Wed, 28 Dec 2022 18:04:38 -0300 Message-ID: Subject: Re: [PATCH] Add example to rand.3 To: Alejandro Colomar Cc: Jonny Grant , Michael Kerrisk , linux-man , GNU C Library , Florian Weimer Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Dec 28, 2022 at 5:57 PM Alejandro Colomar via Libc-alpha wrote: > Ahh, I didn't connect the dots the other day! We don't need to wait for glibc. > libbsd already provides arc4random on GNU/Linux systems, so I can already > recommend using arc4random to seed srand(3). > > I'll prepare a patch... > I would suggest avoiding that, as it suffers from all the problems previously discussed on this list , on the relevant arc4random thread tl;dr , it can't be safe without kernel support, as you need to know when to drop the buffer. (on fork, on resume plus on $deity knows condition for which there is no kernel notification about)