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 BF4A9C433FE for ; Tue, 11 Oct 2022 06:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Qirw48xc/tsq9oJ9bN2wDgpC7gkOILHLI1FFvZKjy0g=; b=DdBo8dOFPn8Q6bDlqsBDTn6vET rNtb/tjW9qg+h3OJstk9ls55q4F5HXkS1wmk1TADpOP8d/LdgU51zMVsg4iV8if6mTOYlWjRKb/X6 a/ILEZnk2MThABtId7PgwzJc1UbjsqBAmkzgngFDcre1tyRwtkR8GBeqpzbOzc/7qDvfTB34PTu4P M3cPQ96i46rB/N+shiEQDNoGNUaPkT7VjEJA7Mv7WZJNHoYbDvrEOeMARlVxDjrDUVDt0NngPkXKA vysUeY9MFGJFLUFhRbVu7Z9wzMgvpWiswThLo5IyZ/wxCSOX0J7khg/NH4+pd5Ig1w/ysmsbG+t1C kJn6icMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oi8M7-003Kyz-5o; Tue, 11 Oct 2022 06:03:07 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oi5VJ-0034DT-Ji; Tue, 11 Oct 2022 03:00:26 +0000 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)" 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221010_200025_746140_BE660253 X-CRM114-Status: GOOD ( 17.62 ) X-Mailman-Approved-At: Mon, 10 Oct 2022 23:02:21 -0700 X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.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