From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53098C433EF for ; Mon, 25 Jul 2022 09:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mBqvSEeV1hDASj5zr+xeUnF2lPrSNKV9tzE63inXQDY=; b=G9uBKvIWK6BfFN 7x5JNgZ+aiSWGCutPiCbjIlhUZsk9qXwv/VcAEJKOC/HrjLsaoDNkEY6EJ763+3wvHH6eCtckx+zp +NPTTktiiN1Da+MyAbew3HJQ476smm40L54EkXpTAjgpmKc2QlOe48Vld+KEvqL4E5fEsp9QlRDTF DTWmtfY1qWripuR1IJOdE+9mR9m8CwT2adH5gXg/WYagkwVMHnhrj0poluwsF1dfG5AU4d+BL130r Fk0l/iRvMjhxtPdzMSsMTL82/Hhp9Gfe6nZhJhQ7Q9WhAg9w1A9DdsMu6+yxu73buEtcNXXhhq7Uo RnF/HrCng8QyqMHbGy9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFuWC-007gdu-Bf; Mon, 25 Jul 2022 09:36:52 +0000 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFuW9-007gX4-4D for linux-arm-kernel@lists.infradead.org; Mon, 25 Jul 2022 09:36:50 +0000 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-172-GO85KoGYOjODgFAl2lFN8g-1; Mon, 25 Jul 2022 10:36:37 +0100 X-MC-Unique: GO85KoGYOjODgFAl2lFN8g-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Mon, 25 Jul 2022 10:36:34 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.036; Mon, 25 Jul 2022 10:36:34 +0100 From: David Laight To: "'Jason A. Donenfeld'" , Borislav Petkov CC: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-s390@vger.kernel.org" , "x86@kernel.org" , Will Deacon , Alexander Gordeev , "Thomas Gleixner" , "H . Peter Anvin" , "Catalin Marinas" , Heiko Carstens , Johannes Berg , Mark Rutland , Harald Freudenberger , "Michael Ellerman" Subject: RE: [PATCH v3] random: handle archrandom with multiple longs Thread-Topic: [PATCH v3] random: handle archrandom with multiple longs Thread-Index: AQHYoAilymPUWo/DTE6/vTfbMGZrFK2O06Jg Date: Mon, 25 Jul 2022 09:36:34 +0000 Message-ID: <10561a841a7342c882aabb0fbdbfc762@AcuMS.aculab.com> References: <20220719130207.147536-1-Jason@zx2c4.com> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220725_023649_464659_3772485E X-CRM114-Status: GOOD ( 11.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ... > More directly, the reason we don't want to error is because the use case > has fallbacks meant to handle errors. The cascade looks like this > (quoting from the other email): > > unsigned long array[whatever]; > for (i = 0; i < ARRAY_SIZE(array);) { > longs = arch_get_random_seed_longs(&array[i], ARRAY_SIZE(array) - i); > if (longs) { > i += longs; > continue; > } > longs = arch_get_random_longs(&array[i], ARRAY_SIZE(array) - i); > if (longs) { > i += longs; > continue; > } > array[i++] = random_get_entropy(); > } > > It tries to get the best that it can as much as it can, but isn't going > to block or do anything too nuts for that. Do you really want to retry the earlier calls that returned no data? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel