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=unavailable 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 DD9B3C2D0DB for ; Tue, 28 Jan 2020 14:47:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB451207FD for ; Tue, 28 Jan 2020 14:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580222840; bh=TvamCyUd28R9hJdhA5UPtzhsrUyhV0i/yZDmMMumUAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=p4UKzPlBWdRrpmJAA6MEWWq0arIEoODJM26Ua3gfLgVJBiYw7BDdg+j0KG4T8/332 asJ8RTP6qGEQPGq3av5NPrTZefs2w79oQ4emOR9VxdDduiAkI0yq7oEHyoKyCM1vjf VrPdcRdhj8Y91cnDoqG0x5YHT0g80Wc+umE1y6X4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbgA1OHv (ORCPT ); Tue, 28 Jan 2020 09:07:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:55664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726670AbgA1OHu (ORCPT ); Tue, 28 Jan 2020 09:07:50 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 3CEE022522; Tue, 28 Jan 2020 14:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580220469; bh=TvamCyUd28R9hJdhA5UPtzhsrUyhV0i/yZDmMMumUAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xSU5ShH+75nzQXRST/DIqJpDPkdgdMvnrW83lOPUCz7VHSD9FqNgzjkZ2OQqWmKd7 d3hA89iHG2NFVCP8knCUPWcuMPzZleFTUzvyPkOco0aWh8UhfYIwTqp/e3KE4RxUIL WVrg/c/UeaXOPfBstUN1nih8LiNeHN/d2pMBNB0w= 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.4 002/183] powerpc/archrandom: fix arch_get_random_seed_int() Date: Tue, 28 Jan 2020 15:03:41 +0100 Message-Id: <20200128135829.777248003@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135829.486060649@linuxfoundation.org> References: <20200128135829.486060649@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 @@ -27,7 +27,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;