Message ID | 20221013175143.791866092@linuxfoundation.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp409476wrs; Thu, 13 Oct 2022 11:04:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM676y0xWKzH+epmoPc36BvsBouUb/qCs26DRWUhlozDSt4GsNW9WCPMoinLF9+En7Jh4BhV X-Received: by 2002:a05:6a00:3493:b0:562:f7c0:cbd9 with SMTP id cp19-20020a056a00349300b00562f7c0cbd9mr773756pfb.4.1665684292977; Thu, 13 Oct 2022 11:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665684292; cv=none; d=google.com; s=arc-20160816; b=qifAm6oDECnWlVVKfbfn5PPEgdzyApdvviFaMao+MsRif/WM5XeuiJdXM9dITuPibB Bpc7yOd17+6Uug7QVSyf1PPq7ok/LmSymwOch8ocXwzrvVqsQqSn+zIMmVgU2dpoC6Cx yKOZCh+E6LJtJiDEbiYWPhbghhgjiolSYHoaTplhyzctFADQmTxAUZNV7HshYFCPxfQT 6YzhB0r/MU9b+fCrqgLXaVm7JQBwQBl/cYo5bNSl9e+uhM4JJVY8+KxpBGxdsLR2ix7l JGwBvzo+Zt6lw9fDjsJsiSsv0cvSzC4VMV9WonIdLScy93MhGs6AIpyylb6lqG2QUgMh Mrvw== 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=TEa+9wcQTN6Oqv9c5QlN+buJsl5atb3Xa06GanWXoKg=; b=bhuMcCO54INw0+xtkMmeTQVk81qbPBXLfiY7qVKNzIqqjKOTDj7ozc9GVL2U+HLfKI bq+27I6sG2SGSY5R/wU/Ioz/x+945pGA5/VUXEhc5sKrRPh4p8VNQgyPO+mA3WQQZiCY JrHGuH8w4ecNe9FQiUhjmEjlvQinToCEHr8wc8Qne31tQ+1F6WAbXqvJYBEPLKbk1CNh 5xx2PUvNj41BHZVkDXFdyTHYFDxy8vxSuYOOFnlBJPSCQcDuO5Avczyzj2mcBX+JtwH8 CxDhV6CS9e5FwRKauBm/icb0uSfe79eBkGZdQFX8WIsjAyy84b4AgI7RPpGPdlA0g6Od 7FkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="LS2mzlz/"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a170902dad000b00177568a0e53si451664plx.252.2022.10.13.11.04.39; Thu, 13 Oct 2022 11:04:52 -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="LS2mzlz/"; 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 S230463AbiJMSC4 (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Thu, 13 Oct 2022 14:02:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230453AbiJMSC3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Oct 2022 14:02:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 780C611465; Thu, 13 Oct 2022 11:02:26 -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 98879B82050; Thu, 13 Oct 2022 17:58:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9A31C433D6; Thu, 13 Oct 2022 17:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665683919; bh=SzjUWlrxdx6dSBn+CgiQOoaJon3rIv0huAMKubMWhmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LS2mzlz/b5Kdya9N8IqyEurfMDytA4edDfDeSbIDYL3REvu4ea7HDWrPj8vFLd6Sn TdOXRbLBTAF1LUTA/HjeeiuBSMt2+4of6iUHoPJRV6dIZVdMLa2FfYkkd7p2JzbDMS bsC1whr5v7gOQELPhVJfCWdhmlmAMs0XB2H/xyfk= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, "Jason A. Donenfeld" <Jason@zx2c4.com> Subject: [PATCH 5.15 07/27] random: clamp credited irq bits to maximum mixed Date: Thu, 13 Oct 2022 19:52:36 +0200 Message-Id: <20221013175143.791866092@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221013175143.518476113@linuxfoundation.org> References: <20221013175143.518476113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746596573141075566?= X-GMAIL-MSGID: =?utf-8?q?1746596573141075566?= |
Series |
None
|
|
Commit Message
Greg KH
Oct. 13, 2022, 5:52 p.m. UTC
From: Jason A. Donenfeld <Jason@zx2c4.com> commit e78a802a7b4febf53f2a92842f494b01062d85a8 upstream. Since the most that's mixed into the pool is sizeof(long)*2, don't credit more than that many bytes of entropy. Fixes: e3e33fc2ea7f ("random: do not use input pool from hard IRQs") Cc: stable@vger.kernel.org Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -980,7 +980,7 @@ static void mix_interrupt_randomness(str local_irq_enable(); mix_pool_bytes(pool, sizeof(pool)); - credit_init_bits(max(1u, (count & U16_MAX) / 64)); + credit_init_bits(clamp_t(unsigned int, (count & U16_MAX) / 64, 1, sizeof(pool) * 8)); memzero_explicit(pool, sizeof(pool)); }