Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3089735rwb; Mon, 15 Aug 2022 17:52:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Mti9neir1ewYrlZotcvp0HDJaplYyuDWr7Ca0T7cUn1fXHGGsaInPUyxy1piY1tT6tfrw X-Received: by 2002:a05:6402:530e:b0:443:df38:9df with SMTP id eo14-20020a056402530e00b00443df3809dfmr4303861edb.9.1660611163707; Mon, 15 Aug 2022 17:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611163; cv=none; d=google.com; s=arc-20160816; b=ce5TMhIidg25Jd83xq/f1+VfqB4mWfDbe0xMcGgV946cc9p8C9NatT3Az+2vfhzrDu hwlvUhrQd0VFPiAf52+Lqwc5wa1DHPLSxJ1ivmJCrbjeBmfjIorUP+XY+ipyvpuuMaM1 x5N4kG5w9Ave31jnDRDGAuVXEBeu5sgtIAS940AHGjS1x9KIi584WLLf5wnANDA9W5In UKPcAIzyhGU80WtJ0G7FUSKfMW9emPAaxmXCOoWYXWCPXvREOFmo2x5GXqfGr2vXqP1Y pwWRcIzudDZXUqhX1ERYHCyVdZQ7Rf1Drks2cY4RygsQXXoZgl3pZic9rZHy19IQX020 1YDQ== 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=/I0ZZWaUYC5tQpy2GSQZN7oR2O+d6A6KL+7k3ZaTNzU=; b=CzQYY6t+wJFFkUHm1d8nF07i/RG+z/+ncYFz7VxvuYv49BalkTAEW2wikQpnefG3sM 42nnKz2Jq8ipjbOGW4HBP5JMAyjUiIiJirPoaUMzRHZYtY1CCPIXAzMbwYJsk6qtRG4T +ITradW82wg6xm1+T0SPEs23FScUdneLZDnOsy5InkILtgxi8bl+hPG6vwHDRaBU9Xup DKv2hnR5/0S2fD88A6kJNr0NDiSX2R4GRu5Q+QxogDWoLRobOqU3o5m63aV/AA0qFmdM gikDM3DKqgkjOzELGUVn8BgqNrv2Pok3SyoLS3Q+19dwd2xpaLleQ5PniPkiupvb7MLt M5uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=knRDWrs4; 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 ht20-20020a170907609400b0073834629361si6769833ejc.379.2022.08.15.17.52.15; Mon, 15 Aug 2022 17:52:43 -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=knRDWrs4; 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 S1354250AbiHOXoD (ORCPT + 99 others); Mon, 15 Aug 2022 19:44:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354153AbiHOXl3 (ORCPT ); Mon, 15 Aug 2022 19:41:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ABC213263F; Mon, 15 Aug 2022 13:10:48 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 04E1C60B6E; Mon, 15 Aug 2022 20:10:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11464C433D6; Mon, 15 Aug 2022 20:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594247; bh=vDkvebUt7MZA8+U3hS5joEOkD7qc/yPP/d1mBQwSSSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=knRDWrs4cwEwisOzd9V0laaCCsJS3E98QZ4K+20hjQOjPcvMZD4WX6toC8eUZoQI7 2L9s3/LU8MHYQscLM/5tJFrwzE5E1n7kY5LmOk17utfaoJ4VQUAGF1KdiotFIGHMxo cTFqIy/yPxWcsbHc8JjVFJNq/xudHS+55Wpcadjk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , "Jason A. Donenfeld" , Herbert Xu Subject: [PATCH 5.18 1078/1095] crypto: lib/blake2s - reduce stack frame usage in self test Date: Mon, 15 Aug 2022 20:07:57 +0200 Message-Id: <20220815180513.639968639@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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,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 d6c14da474bf260d73953fbf7992c98d9112aec7 upstream. Using 3 blocks here doesn't give us much more than using 2, and it causes a stack frame size warning on certain compiler/config/arch combinations: lib/crypto/blake2s-selftest.c: In function 'blake2s_selftest': >> lib/crypto/blake2s-selftest.c:632:1: warning: the frame size of 1088 bytes is larger than 1024 bytes [-Wframe-larger-than=] 632 | } | ^ So this patch just reduces the block from 3 to 2, which makes the warning go away. Reported-by: kernel test robot Link: https://lore.kernel.org/linux-crypto/202206200851.gE3MHCgd-lkp@intel.com Fixes: 2d16803c562e ("crypto: blake2s - remove shash module") Signed-off-by: Jason A. Donenfeld Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- lib/crypto/blake2s-selftest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/lib/crypto/blake2s-selftest.c +++ b/lib/crypto/blake2s-selftest.c @@ -593,7 +593,7 @@ bool __init blake2s_selftest(void) enum { TEST_ALIGNMENT = 16 }; u8 unaligned_block[BLAKE2S_BLOCK_SIZE + TEST_ALIGNMENT - 1] __aligned(TEST_ALIGNMENT); - u8 blocks[BLAKE2S_BLOCK_SIZE * 3]; + u8 blocks[BLAKE2S_BLOCK_SIZE * 2]; struct blake2s_state state1, state2; get_random_bytes(blocks, sizeof(blocks)); @@ -603,8 +603,8 @@ bool __init blake2s_selftest(void) defined(CONFIG_CRYPTO_ARCH_HAVE_LIB_BLAKE2S) memcpy(&state1, &state, sizeof(state1)); memcpy(&state2, &state, sizeof(state2)); - blake2s_compress(&state1, blocks, 3, BLAKE2S_BLOCK_SIZE); - blake2s_compress_generic(&state2, blocks, 3, BLAKE2S_BLOCK_SIZE); + blake2s_compress(&state1, blocks, 2, BLAKE2S_BLOCK_SIZE); + blake2s_compress_generic(&state2, blocks, 2, BLAKE2S_BLOCK_SIZE); if (memcmp(&state1, &state2, sizeof(state1))) { pr_err("blake2s random compress self-test %d: FAIL\n", i + 1);