Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp557024imn; Tue, 26 Jul 2022 03:27:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sOV3L3LxP12fLNzxf1J3bkqooVZvQbzAsNLDU57VIP2U+wXyT6g7OuRBdA1gAHwxG+UL9r X-Received: by 2002:a17:902:e549:b0:16d:69a6:9667 with SMTP id n9-20020a170902e54900b0016d69a69667mr10799898plf.38.1658831228742; Tue, 26 Jul 2022 03:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658831228; cv=none; d=google.com; s=arc-20160816; b=hFJA6UUGfALrEuECLIAifANFcQMr+8U5xOwJruMWPoelxQJCPwPhpdpmRlO4agbkoC G9X0WMNvZqIL8KyHSjfQRtMvp9qB0HQY2i/vltVCuDl45+caAW2Y1JmRqnTYXFz3bj1d WpTsV7IrH44/VWCuE4m60CzhyYkNLZ22e/cgE9PynUdFB9dLmj1tTT8dkCR9epPkNuPx Uxm+GbfoHPpm1jpzd5ccvDIzvKOsGAUh0qXmJi//QXVa+Y3slV24ULeQjmg4N0xiqOcZ WmXrM4YpZ6xLhXLosO51w67c7grWPEHoSD5GoujOxRVQXpDFMTV3vGAqJLRUUbTVyC6S snug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XsE0nz7DV+yVLaXm6kfzuk9277kz+h0KY+YmIq37ZeE=; b=sNOy3+VrWXumiILE6L9BmXWWZ+pOh+gNRZ3HOuWtLF7ULYSMgMOLSbJh7rZUcV9k+Z MwZPffO6QUNR8POA/ExzyptUzmUJLQ+7S8aw91r3OS0FPzM0rr3k8+EcgpKZciGDHucO I+L8DbseNtrRUkWILcx91gRSVQpK0bDmlW3AZvawwiRkWc/FkMGlXLxO714GC43H+52s MqZd60iCMUIWVd3D+BXOEoJvwUAQhJ6VKPbNQj4NxKKuimOVWUDr2ftG6V/Wx4XE0sEx jIby+egw2ewsYzQQSF6mzR+a4Ao8IbcJr3vS9J9SmETc2Qx/VmHjhDCaRtPhpbNVlWVb MYeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=bLfiYKw6; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g5-20020a17090ac30500b001f0c7936843si17469526pjt.69.2022.07.26.03.26.42; Tue, 26 Jul 2022 03:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=bLfiYKw6; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233133AbiGZK0N (ORCPT + 99 others); Tue, 26 Jul 2022 06:26:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231345AbiGZK0M (ORCPT ); Tue, 26 Jul 2022 06:26:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B74D4221 for ; Tue, 26 Jul 2022 03:26:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6C19BB8122F for ; Tue, 26 Jul 2022 10:26:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52E60C341C0; Tue, 26 Jul 2022 10:26:08 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="bLfiYKw6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1658831166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XsE0nz7DV+yVLaXm6kfzuk9277kz+h0KY+YmIq37ZeE=; b=bLfiYKw628JbNbTcemH0VhU33ZjaPgGKpvhDRkCyfbWadP1Tf6ibnF2LdV/9nYFJfRtWoz 2F/btr+YhcICMmaXC79ShHm/or7DdpD1GZwHI2wDaEBkAvqkZIvrTRPXGQFSCqd4sM3sqV 6FdlJgVQtAW8EPGLyEeKmLf4SO/5iFI= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 8fcbf43a (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 26 Jul 2022 10:26:06 +0000 (UTC) Date: Tue, 26 Jul 2022 12:26:04 +0200 From: "Jason A. Donenfeld" To: Eric Biggers Cc: libc-alpha@sourceware.org, Adhemerval Zanella Netto , Florian Weimer , Cristian =?utf-8?Q?Rodr=C3=ADguez?= , Paul Eggert , linux-crypto@vger.kernel.org Subject: Re: [PATCH v2] arc4random: simplify design for better safety Message-ID: References: <20220725225728.824128-1-Jason@zx2c4.com> <20220725232810.843433-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Eric, On Mon, Jul 25, 2022 at 04:59:17PM -0700, Eric Biggers wrote: > This looks good to me. > > There are still a few bits that need to be removed/updated. With a quick grep, > I found: > > sysdeps/generic/tls-internal-struct.h: struct arc4random_state_t *rand_state; > > sysdeps/unix/sysv/linux/tls-internal.h:/* Reset the arc4random TCB state on fork. * > > NEWS: ... The functions use a pseudo-random number generator along with > NEWS: entropy from the kernel. > > > Also, the documentation in manual/math.texi should say that the randomness is > cryptographically secure. Thanks for the notes. I'll clean that all up in v3. Jason