Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6135099iog; Thu, 23 Jun 2022 12:05:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t6kuAVcXmqeHIjoHXFbXhwkePTfFTm36pJdK6vwIwb2SMkwJmZ4L6znCb4FogpjJASMy2H X-Received: by 2002:a62:3145:0:b0:525:1309:36f8 with SMTP id x66-20020a623145000000b00525130936f8mr28652370pfx.74.1656011100103; Thu, 23 Jun 2022 12:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011100; cv=none; d=google.com; s=arc-20160816; b=IMVDcIzR9jR/9YOQG17Ny2bO0mwvXbC4+cNTasr8/UbGhGLAkj53p6UjiDYbmTa4sG j0KcEiCwpZ1z6loxt8M98JEZjZ+IbLtzblH4Eb7udEGvGzqWZVB0BQrSQ3oIA5eJq/VX RTbl7yY4tBFtkFYG8/A7YgnlSJu2zCv68WZmmvcjbrzyiWDjmtPFxWH4yP1ByxVS2GKK fHbdFCDacYYA250hqEgROiFcTTzpIGJJolliJlJQ5HlwK2ODCkaKWEZETL0Bz8i+Nk58 TxE+IulFF9a1vrvm09+FQcO7jAQ8mEvMvD0obiQ176iC0IhS1dz9HJo5uYPW2zIT1hOt tkRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Fyra5OTauDH+lHnDU3SpodZN3DD3ezSUcn0ZA5Nc/dg=; b=iMKdqb4KFu/WveOJkjj4u2E/dpYYQ9j5WfUxIhXd9NFXyAjNcOV/ES+ikJ+xMaHtOW 3Cf6UXDwHUTB+l1cuzgBq8XRsRLyGMQYnD5TDMNKcSkTakTRSd8mTOVaIyjfHQJKbpt7 VAZbpnvI5xLUgjuP6ktxty3AKHBhEF0QBA7vkG3zS6u7yNdYn9zqPlWwe0db+Ds6xzP9 LAehgOW7f1l0B8WWs5ijGvmx33BpYNxroGweMN2jjA/m9dKi8Wsxf/5XoIS0HMvXeAC/ aISPQpz/F+wNobt+7eNrQ1/m9D8ByU8Ho+dRfi2KCnXrXyBw/63YnKUVedgd+yWZ83P6 5HAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gl4Ixmp5; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a170902748500b0016184e70124si328727pll.192.2022.06.23.12.04.46; Thu, 23 Jun 2022 12:05:00 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=gl4Ixmp5; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232946AbiFWRFN (ORCPT + 99 others); Thu, 23 Jun 2022 13:05:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233918AbiFWRD1 (ORCPT ); Thu, 23 Jun 2022 13:03:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53E2B51332; Thu, 23 Jun 2022 09:55:09 -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 ams.source.kernel.org (Postfix) with ESMTPS id 9CD98B8249D; Thu, 23 Jun 2022 16:54:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D4D1C3411B; Thu, 23 Jun 2022 16:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656003285; bh=UsU2/f9tNduGPzdf8mqaOjn4woxltzh/t+6svdIsniU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gl4Ixmp5mrNf5jpL7N0hxSXo3/oWTjRBYtAIG825BCNxFWgXYattZBApyJ49qIcbL 76ouRIEqIkcU7mx7nOGDfBcpW/JGq+o5PmfOVbh+bJcLqCukLqAaUGShMzV/k3nBqN dd6Zv3KzLIe5ppxPuD47XIzWWmUvZlJOkPM70OSU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Arnd Bergmann , Richard Weinberger , Anton Ivanov , Johannes Berg , "Jason A. Donenfeld" Subject: [PATCH 4.9 189/264] um: use fallback for random_get_entropy() instead of zero Date: Thu, 23 Jun 2022 18:43:02 +0200 Message-Id: <20220623164349.416044839@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: "Jason A. Donenfeld" commit 9f13fb0cd11ed2327abff69f6501a2c124c88b5a upstream. In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies eventually. It's not as though random_get_entropy_fallback() is super high precision or guaranteed to be entropic, but basically anything that's not zero all the time is better than returning zero all the time. This is accomplished by just including the asm-generic code like on other architectures, which means we can get rid of the empty stub function here. Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: Richard Weinberger Cc: Anton Ivanov Acked-by: Johannes Berg Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- arch/um/include/asm/timex.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) --- a/arch/um/include/asm/timex.h +++ b/arch/um/include/asm/timex.h @@ -1,13 +1,8 @@ #ifndef __UM_TIMEX_H #define __UM_TIMEX_H -typedef unsigned long cycles_t; - -static inline cycles_t get_cycles (void) -{ - return 0; -} - #define CLOCK_TICK_RATE (HZ) +#include + #endif