Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6382870rwb; Mon, 12 Dec 2022 00:44:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Ho4R12z6/g/YSEHKbyKfdC3ibKqX5sK+HiRqmxLKkXi/MLybX5UnIWIJ4y+eau8LJXpIq X-Received: by 2002:a17:906:1150:b0:7c0:db53:c5ab with SMTP id i16-20020a170906115000b007c0db53c5abmr11849121eja.25.1670834685563; Mon, 12 Dec 2022 00:44:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670834685; cv=none; d=google.com; s=arc-20160816; b=S4hIvaBZOky0Eo/Q6jTL8rWB1y4eAlIlGp96dyxaBPyfp3Mk7S7O84Ro8EU9cDOlsK byiJLilahLxdf7BRHb00jLnn9Doc3KBMWLNxqH31jM4E4tK1vKBHdE/erwpktx0V9SNo NKpAKK0l3XZmL/Q19yufn9i3Bt5AcHN2I262iuLO96Ke3bokuq2LcLLFl4GxP8uIb4m5 lMVhMYNEX/C5S03lueIv2pCGnOH9E9/eoaiFJOk7UImCxauCj2m511oTiLAhgD9iaS2/ N/awJUcy4Otv5zEspEzYNC0rOEt2UtRMypJ1bPPATksTJ/WpjNt7mtQb0fEiH7EwKv5Z QT6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=vJ0e6TlPBu+QqbSE8efHwpDcCI1V8Fh4DjFbNdb2my4=; b=o4F84+KiL79umECDL5dhKqHGe/qAdw3UytPjVDz9DURtDzHUgypudQ7CnyBpJdrj62 ge391MMzrmM3j3/vMxBdYQX1Y/mN/PcCVL1XfWmdyL4+bprcLLs1bRuDJpQG6ZTD2dL1 Lai20G5fsH2fIqd4Y9exzMo87/O1/pwxw4kFWUB4qhu1HR7OZPngpbbFNIUxQSF3TETH OeaLm4M4QC+xq+fK/pGNgcCulNVkTNjuq+Iht0FEiB9pkGlzrFr9vPKjZxr1Y9pknhVa N8zM85QGjmUMWeAfd23tLeNmNVflsEqF8PFlKzldE643jwSFjhYBSHs7H2qSsWXuHh5U zx7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ctpcli0Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ae13-20020a17090725cd00b007ae1e635ea3si6031830ejc.754.2022.12.12.00.44.24; Mon, 12 Dec 2022 00:44:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@intel.com header.s=Intel header.b=Ctpcli0Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231555AbiLLIgN (ORCPT + 76 others); Mon, 12 Dec 2022 03:36:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231343AbiLLIgC (ORCPT ); Mon, 12 Dec 2022 03:36:02 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AAFCDFAA; Mon, 12 Dec 2022 00:36:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670834161; x=1702370161; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=bFYTa27LxNC965Nl6ptrEOem3ftkvwtR2lcZjjhuh7w=; b=Ctpcli0Qu5gkHgOCOhBib4kAIwQyDbs9RvQiX3xGNTUYi3eEQQ7U3Nuh 0dNICWlhMfnaQYPoU6fK7JzSMFJDDJmY7r/cQed6pd5h25++CSYhvj4/I tyiGi6964uzL1ir573stEVlhaVjcIh9rKbD1oLqgsOG9ZxlnyASN5wcm+ iBMv4ly/I6ElKrv0u23X4YzRGAckMGAUnRWiXK+E2CSXwQ03CEUQCI2P8 vBQNkmWz8CxDxJBaJfeVp/XUnYPcnsQXXPi/I3k+A76sheagMOzPYamGM Xg519DOI/27uQeUYXxixZD14ABPLZRnRsO7Yy89Iwn9bnfMlD0/aPSUZ9 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="380011023" X-IronPort-AV: E=Sophos;i="5.96,237,1665471600"; d="scan'208";a="380011023" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 00:36:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="822407894" X-IronPort-AV: E=Sophos;i="5.96,237,1665471600"; d="scan'208";a="822407894" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga005.jf.intel.com with ESMTP; 12 Dec 2022 00:35:56 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p4eHx-008Nh5-28; Mon, 12 Dec 2022 10:35:53 +0200 Date: Mon, 12 Dec 2022 10:35:53 +0200 From: Andy Shevchenko To: david.keisarschm@mail.huji.ac.il Cc: Dave Hansen , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-mtd@lists.infradead.org, linux-scsi@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/5] Renaming weak prng invocations - prandom_bytes_state, prandom_u32_state Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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-kernel@vger.kernel.org On Mon, Dec 12, 2022 at 12:16:04AM +0200, david.keisarschm@mail.huji.ac.il wrote: > From: David > > Since the two functions > prandom_byte_state and prandom_u32_state > use the weak prng prandom_u32, > we added the prefix predictable_rng, > to their signatures so it is clear they are weak. It's fancy indentation. ... > /* Fisher-Yates shuffle */ > for (i = count - 1; i > 0; i--) { > - rand = prandom_u32_state(&state.rnd_state); > + rand = predictable_rng_prandom_u32_state(&state.rnd_state); Isn't it too many "random":s encoded in the name? I would leave either "rng" or "[p]random". > rand %= (i + 1); > swap_free_obj(slab, i, rand); > } -- With Best Regards, Andy Shevchenko