Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp458331ybl; Tue, 28 Jan 2020 06:17:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwc9V37yt4JrW0FuvQZ4psSKCtk2U0d5Owff9tN0I2NXXQkBzGaymRR4FcU/sRfrtUxi/MZ X-Received: by 2002:aca:814:: with SMTP id 20mr2956526oii.159.1580221061498; Tue, 28 Jan 2020 06:17:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580221061; cv=none; d=google.com; s=arc-20160816; b=PNoSpriO8rVIDj7m/pnTZ2DM1H1KUKEHebBHulM8sffZ0FUAx9IujPvd4o/jOIWGi0 wDlJe1TUQUkkbBIwr+C0CzVxaJZX5I6Zh5a/0qmz5pfDnsZx8FXlTynUp9ZN3g/R2YUm x9MKZC0in84zti6hoIZAj/4G+YlSDtjp+CuEW/yATLVloOJCrV1aC65rEtPfretv9QCS 6Ckzv0zG/8Co0/JncuYolQjy4Zse93B+PRKAJEIzQeeMiqhe9MXb5pvjkU3mmcO/a7WE o1Dln/ckWpueoaeDJMAEXlT9BoSioGNeyFEDjyQSlKDgha0FxbXqiG4Mr9T7HDLTS//U 9sqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YcjdsBjWcUsSoY03LpIw04xyQTKeELWuOOqzIonANmU=; b=yK5yOTdCL/5uClq8x9TvWlYXqT+f9fsHEQpDB3Bcx3vWentP9g7xq5Zzoqwhx0Vd8c dOUzL8MjDiwVj86IsLYWbrORLxZkOirPy1Uk1/ZqJ9xWxP7ujHwzGAmmoSyz9lWtiBBx 5h5Esp2IkAFdUMaQGBhaFCKmRIfq2+NmW6GkBsRZSL70VpdC6LIyM5NP7BaN102ZAg8K 8nYbgnyoxrdU0LRfOiA8ABLVuFUhf0tmd9QTu4nJe/x+t+GCyRDtcGixDA2FtWPTO7iD q3nJUGvbHZ/+FW7LmyFUGsHzF3u0iIYuiFJoE6+8x6DmUKmbBpJtAcSARXSKpA3+uOsk 5WGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cZjWtpKa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q19si7555795otm.221.2020.01.28.06.17.27; Tue, 28 Jan 2020 06:17:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cZjWtpKa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730119AbgA1OPb (ORCPT + 99 others); Tue, 28 Jan 2020 09:15:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:38204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729852AbgA1OP2 (ORCPT ); Tue, 28 Jan 2020 09:15:28 -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 8D35224681; Tue, 28 Jan 2020 14:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580220928; bh=TvamCyUd28R9hJdhA5UPtzhsrUyhV0i/yZDmMMumUAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cZjWtpKaEU+gtNs+xoy35E3RVgzxMj1NtZW24DTuLMzJ4RFNl4+AVmjWCHh1fuLxw 5fTU9NJb/3/qpYpKlm5o5acU9qBUzVfJRAkaOwPaqsbItHsJc4xfjsjeCqcQ6WdYIE HBC5OzLN3YVrXQmpnZl44ieKAcx2BvnjRXLOHFRA= 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.9 002/271] powerpc/archrandom: fix arch_get_random_seed_int() Date: Tue, 28 Jan 2020 15:02:31 +0100 Message-Id: <20200128135852.601343291@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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;