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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 76822C433FE for ; Tue, 11 Oct 2022 03:55:09 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Mmhkg4Zjpz3drn for ; Tue, 11 Oct 2022 14:55:07 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=zx2c4.com header.i=@zx2c4.com header.a=rsa-sha256 header.s=20210105 header.b=HINC5krz; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=srs0=ame8=2m=zx2c4.com=jason@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=zx2c4.com header.i=@zx2c4.com header.a=rsa-sha256 header.s=20210105 header.b=HINC5krz; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4MmgWZ52bVz2xJF for ; Tue, 11 Oct 2022 14:00:26 +1100 (AEDT) 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 BD5A76106D; 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)" 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-Mailman-Approved-At: Tue, 11 Oct 2022 14:54:15 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-wireless@vger.kernel.org" , Ulf Hansson , "x86@kernel.org" , Vignesh Raghavendra , "linux-doc@vger.kernel.org" , Peter Zijlstra , Catalin Marinas , Dave Hansen , "kernel-janitors@vger.kernel.org" , KP Singh , "dri-devel@lists.freedesktop.org" , "patches@lists.linux.dev" , "linux-mm@kvack.org" , Eric Dumazet , "netdev@vger.kernel.org" , "linux-mtd@lists.infradead.org" , "kasan-dev@googlegroups.com" , "H . Peter Anvin" , Andreas Noever , WANG Xuerui , Will Deacon , Christoph Hellw ig , "linux-s390@vger.kernel.org" , "sparclinux@vger.kernel.org" , Mauro Carvalho Chehab , Herbert Xu , Daniel Borkmann , Jonathan Corbet , "linux-rdma@vger.kernel.org" , Helge Deller , Huacai Chen , Hugh Dickins , Russell King , Jozsef Kadlecsik , Jason Gunthorpe , Dave Airlie , Paolo Abeni , "James E . J . Bottomley" , Pablo Neira Ayuso , "linux-media@vger.kernel.org" , Marco Elver , Kees Cook , Yury Norov , Heiko Carstens , Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , "linux-um@lists. infradead.org" , "linux-mips@vger.kernel.org" , "linux-block@vger.kernel.org" , Richard Weinberger , Borislav Petkov , "linux-nvme@lists.infradead.org" , "loongarch@lists.linux.dev" , Jakub Kicinski , Thomas Gleixner , Andy Shevchenko , Johannes Berg , "linux-arm-kernel@lists.infradead.org" , Jens Axboe , "linux-mmc@vger.kernel.org" , Thomas Bogendoerfer , Theodore Ts'o , "linux-parisc@vger.kernel.org" , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , Florian Westphal , "linux-kernel@vger.ke rnel.org" , Christoph =?utf-8?Q?B=C3=B6hmwalder?= , "linux-crypto@vger.kernel.org" , Jan Kara , Thomas Graf , "linux-fsdevel@vger.kernel.org" , Andrew Morton , "linuxppc-dev@lists.ozlabs.org" , "David S . Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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