From nobody Tue Dec 2 00:45:59 2025 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63C1A27472 for ; Sun, 23 Nov 2025 18:26:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763922379; cv=none; b=CpgI/pKY5gtbpcH9bw1dPh06DxThyFeyFm10sn+leJv31qQCwGdVMWrXM9/PGRqx81TICrXXBYx/HIPMe924Dv0bkFfc+Y5BH/PBkjSoRN1Ls8PjJdpIBQkXmYFfJfanr4Wchkx2OWQKsYYqypi7cX0dn79gK1Nf08J/06OkLEg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763922379; c=relaxed/simple; bh=W1WInrZdod/pGOfdHqhFH+p4im7ZgANDIO0VEZjJ+ww=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gp3B9H4DvohITXSlxsEXgdexw30t9N0LDA3/uyABAMRqa0i4sx4t6d4nhV6INXrY/9R6k35C2KtCJ/kN4UIxWIVzpxZNwqh3uP4Qq+oXyZqceGwSlvLpTL5499gv5Hy3SCXRWbw2eqrgtJKScfpUenfh8LOxvqTaoj+BHGMGonI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ifTeg2kQ; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ifTeg2kQ" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1763922364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=p88zTGcneeVkeEymviXLaW2rR8NcRq8Hspl2QfLX5ZM=; b=ifTeg2kQmUuivZPPwqhRJXU9HSwXKSJrOlb0CpIBX1O4dgym+JhIEJTJSXLdeYj4IMGOK+ 5julahzav9eZVoaipdKgmuf2fROHSF3/62cHPcOEjgWoByxnSgf7q6jB6kpUgQIXWMfLH2 +VEx4Lef8ITJ2uEQBYZr6Ncb66RBtL4= From: Thorsten Blum To: Eric Biggers , "Jason A. Donenfeld" , Ard Biesheuvel , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: Thorsten Blum , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH v2] lib/crypto: blake2b: Limit frame size workaround to GCC Date: Sun, 23 Nov 2025 19:25:17 +0100 Message-ID: <20251123182515.548471-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" The GCC regression only affected i386 and has been fixed since GCC 12.2. However, modern GCC versions still generate large stack frames on other architectures (e.g., 3440 bytes for blake2b_compress_generic() on m68k with GCC 15.1.0). Clang handles these functions efficiently and should work fine with the default warning threshold. Limit the frame size workaround to GCC only. Signed-off-by: Thorsten Blum Reviewed-by: Nathan Chancellor --- Changes in v2: - Restrict frame size workaround to GCC independent of its version or the architecture - Update patch title and description - Link to v1: https://lore.kernel.org/lkml/20251122105530.441350-2-thorsten= .blum@linux.dev/ --- lib/crypto/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile index b5346cebbb55..95a48393ffb4 100644 --- a/lib/crypto/Makefile +++ b/lib/crypto/Makefile @@ -33,7 +33,9 @@ obj-$(CONFIG_CRYPTO_LIB_GF128MUL) +=3D gf128mul.o =20 obj-$(CONFIG_CRYPTO_LIB_BLAKE2B) +=3D libblake2b.o libblake2b-y :=3D blake2b.o +ifeq ($(CONFIG_CC_IS_GCC),y) CFLAGS_blake2b.o :=3D -Wframe-larger-than=3D4096 # https://gcc.gnu.org/bu= gzilla/show_bug.cgi?id=3D105930 +endif # CONFIG_CC_IS_GCC ifeq ($(CONFIG_CRYPTO_LIB_BLAKE2B_ARCH),y) CFLAGS_blake2b.o +=3D -I$(src)/$(SRCARCH) libblake2b-$(CONFIG_ARM) +=3D arm/blake2b-neon-core.o --=20 2.51.1