Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1612174rwi; Mon, 10 Oct 2022 20:03:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Yod1gdLMQhhPLG1G/17tO5E70BNnonmURBdm1EvuN/4XlWhnxh9+1btwCL4Ou4SCer5XH X-Received: by 2002:a17:90b:1e0a:b0:20d:1fec:21bf with SMTP id pg10-20020a17090b1e0a00b0020d1fec21bfmr14922155pjb.189.1665457416252; Mon, 10 Oct 2022 20:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665457416; cv=none; d=google.com; s=arc-20160816; b=CvPF3bFlDwZ8UxLubwQkK+f7haA7s0q7QwDwrYNQOcpsOYRqLnVfwwG3+EGBgP4c06 vHTckPNraAdkE5VpLVyCZFL3Ap6k0U9hynICKg8DMfrJvrAJHUZo6rZS7OC7U9zU4UMy 16uY1k7AWmuMVOAuY9nrwG3p0pEdpqGlJoaVvjfv3hWTpEYozvc+BI6lTDwpay2Jl612 vK8znJ8VEH/YhgFQ/YuB2W94BB5kWtwZxowB5pxf7WT0HVIb5lrr5do2DpLJDt8IUJLk pLEVpI4sMTtRvP4JEOIGzg50LQOl7p47G/IRUHCPAK+pZLYma0U1mSfTol/mm688OdTz D2WA== 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=Qirw48xc/tsq9oJ9bN2wDgpC7gkOILHLI1FFvZKjy0g=; b=V8SMoOZenbVsWRC0GY1JiCURAqqoewjhNBnLwvWtjHBzDK+7NxOPJ/k8FSkW9uQ2lM 75wy2WFAQNYtBb7OTmvm30pHL4Nfq6OXmvRDRsmAkMgrlU5aSFaecrsbIZj5omlacypK q4k4JVleNSilZ33D2LhNXx9JUZLtu+VU+K9lYpw07ihMKMJdWjgQtz/SPqaWk0CGGEYp clc0rPkB5+jairpN3h9eh025ioG8V3Y8mPNp8sLVjZfqxVJUTygdT/0/NNVn28QeYbxG zd4LWgL4NkLs+GGe2sHHzJAbDdUgJQtvtQiLTKikzLdIHFG90WH79OuXgzWLlerXmXhK UDxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=HINC5krz; 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 oa16-20020a17090b1bd000b0020329ca07cbsi20835645pjb.119.2022.10.10.20.03.21; Mon, 10 Oct 2022 20:03:36 -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=HINC5krz; 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 S229544AbiJKDA3 (ORCPT + 99 others); Mon, 10 Oct 2022 23:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbiJKDA1 (ORCPT ); Mon, 10 Oct 2022 23:00:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8939C51425; Mon, 10 Oct 2022 20:00:25 -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 dfw.source.kernel.org (Postfix) with ESMTPS id C52046108C; Tue, 11 Oct 2022 03:00:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 207E1C433D6; Tue, 11 Oct 2022 03:00:18 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="HINC5krz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1665457216; 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=Qirw48xc/tsq9oJ9bN2wDgpC7gkOILHLI1FFvZKjy0g=; b=HINC5krzVlg2RfBkI+DN4TfkkfdILG81+nGbG6H3ymULtvrDJBAAPyivNN5Ks6xLTRDgBj St0npOJIqnMiQJAEsME6hn8HSGUVr7vaSgTvTLlUyVWoppp8tjC9zJyq6/W2qkBuApVnBr cXYoav/TXzo4IDNClYviVzHvX/Qex3Y= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 0a7ccddd (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 11 Oct 2022 03:00:16 +0000 (UTC) Date: Mon, 10 Oct 2022 21:00:08 -0600 From: "Jason A. Donenfeld" To: "Elliott, Robert (Servers)" Cc: "linux-kernel@vger.kernel.org" , "patches@lists.linux.dev" , Andreas Noever , Andrew Morton , Andy Shevchenko , Borislav Petkov , Catalin Marinas , Christoph =?utf-8?Q?B=C3=B6hmwalder?= , Christoph Hellwig , Christophe Leroy , Daniel Borkmann , Dave Airlie , Dave Hansen , "David S . Miller" , Eric Dumazet , Florian Westphal , Greg Kroah-Hartman , "H . Peter Anvin" , Heiko Carstens , Helge Deller , Herbert Xu , Huacai Chen , Hugh Dickins , Jakub Kicinski , "James E . J . Bottomley" , Jan Kara , Jason Gunthorpe , Jens Axboe , Johannes Berg , Jonathan Corbet , Jozsef Kadlecsik , KP Singh , Kees Cook , Marco Elver , Mauro Carvalho Chehab , Michael Ellerman , Pablo Neira Ayuso , Paolo Abeni , Peter Zijlstra , Richard Weinberger , Russell King , Theodore Ts'o , Thomas Bogendoerfer , Thomas Gleixner , Thomas Graf , Ulf Hansson , Vignesh Raghavendra , WANG Xuerui , Will Deacon , Yury Norov , "dri-devel@lists.freedesktop.org" , "kasan-dev@googlegroups.com" , "kernel-janitors@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-block@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-media@vger.kernel.org" , "linux-mips@vger.kernel.org" , "linux-mm@kvack.org" , "linux-mmc@vger.kernel.org" , "linux-mtd@lists.infradead.org" , "linux-nvme@lists.infradead.org" , "linux-parisc@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "linux-s390@vger.kernel.org" , "linux-um@lists.infradead.org" , "linux-usb@vger.kernel.org" , "linux-wireless@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "loongarch@lists.linux.dev" , "netdev@vger.kernel.org" , "sparclinux@vger.kernel.org" , "x86@kernel.org" , Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Subject: Re: [PATCH v6 3/7] treewide: use get_random_{u8,u16}() when possible, part 1 Message-ID: References: <20221010230613.1076905-1-Jason@zx2c4.com> <20221010230613.1076905-4-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 On Tue, Oct 11, 2022 at 01:18:40AM +0000, Elliott, Robert (Servers) wrote: > > > diff --git a/crypto/testmgr.c b/crypto/testmgr.c > ... > > @@ -944,7 +944,7 @@ static void generate_random_bytes(u8 *buf, size_t count) > > default: > > /* Fully random bytes */ > > for (i = 0; i < count; i++) > > - buf[i] = (u8)prandom_u32(); > > + buf[i] = get_random_u8(); > > Should that whole for loop be replaced with this? > get_random_bytes(buf, count); Wow, that's kind of grotesque. Yea, it certainly should. But that's beyond the scope of this patchset. I'll send a follow-up patch just for this case to Herbert after this cleanup lands, though. Jason