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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D3A4C2D0CE for ; Fri, 24 Jan 2020 09:36:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 175982087E for ; Fri, 24 Jan 2020 09:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579858603; bh=2BOKliKYONPM7G3oQGicFAME9v7YSWM/c/y81Ych7cE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=nGBT05Eh4wzPAD2qp+m1ekFW+HrNZAVCcqmPLuT8DYlSJoZVGHR1WXdvvsGH484bI tg2+OZiQ5X59eSSuwhmcc0A0ohTTiywfZOf5UkZ4yujo4aLa6hfgQQVjEsOwtEFsGj thsrBzqW2yMkmMpZcoHCoVd8AGiQ1562jxXf7J+E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730135AbgAXJgm (ORCPT ); Fri, 24 Jan 2020 04:36:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:34034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726695AbgAXJgm (ORCPT ); Fri, 24 Jan 2020 04:36:42 -0500 Received: from localhost (unknown [145.15.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 335572070A; Fri, 24 Jan 2020 09:36:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579858601; bh=2BOKliKYONPM7G3oQGicFAME9v7YSWM/c/y81Ych7cE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iLb07CSH4aZnPQfTGKHymrioyEAR5LPSCcX/Bd3OKzOdp/I3IwM3Q5gR21L/ijwOd EgcAi2gD58Pksuy5qujwW+wJ0dXCkBCd2aNoDkY4qixa1xlHsSOWUyfaGbbhPWPW7p zw+OSVpRklycXK4CcuDCenWLwsfSvZ+vzyOWpsZU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ard Biesheuvel , Michael Ellerman Subject: [PATCH 4.14 003/343] powerpc/archrandom: fix arch_get_random_seed_int() Date: Fri, 24 Jan 2020 10:27:01 +0100 Message-Id: <20200124092919.983473574@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124092919.490687572@linuxfoundation.org> References: <20200124092919.490687572@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ard Biesheuvel commit b6afd1234cf93aa0d71b4be4788c47534905f0be upstream. Commit 01c9348c7620ec65 powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_* updated arch_get_random_[int|long]() to be NOPs, and moved the hardware RNG backing to arch_get_random_seed_[int|long]() instead. However, it failed to take into account that arch_get_random_int() was implemented in terms of arch_get_random_long(), and so we ended up with a version of the former that is essentially a NOP as well. Fix this by calling arch_get_random_seed_long() from arch_get_random_seed_int() instead. Fixes: 01c9348c7620ec65 ("powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_*") Signed-off-by: Ard Biesheuvel Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20191204115015.18015-1-ardb@kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/archrandom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/include/asm/archrandom.h +++ b/arch/powerpc/include/asm/archrandom.h @@ -28,7 +28,7 @@ static inline int arch_get_random_seed_i unsigned long val; int rc; - rc = arch_get_random_long(&val); + rc = arch_get_random_seed_long(&val); if (rc) *v = val;