From patchwork Mon Jun 17 11:59:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 166997 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2766335ilk; Mon, 17 Jun 2019 04:59:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDNNVy6lSn5ewSj50A7CUpzMMDxh7sJYCLo4cVlQncNDd8VY7RhiPXJkELky5nYi4u7o5O X-Received: by 2002:a63:5656:: with SMTP id g22mr34300290pgm.280.1560772789985; Mon, 17 Jun 2019 04:59:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560772789; cv=none; d=google.com; s=arc-20160816; b=ydcRIhhMwO6qr5TG/iBxzLLtdejjhUpq10/QEEtOMRwB9jFvwDksfOWeKPBMP3IAFF RsUsM/2tmq/ZSfjhmEs8lyFnfpaoagEjM/sL5LPgUHZpBOInXQdTOjRfswlcapzjnYDQ cUBPleZ4hcW5lc68xHieH5SsnN56ulzEDua9HXnqa7PLcUTDSAczFZ5Mto4VaKNuX9VA iYH4k4yPXAlpns3G07XJnHNCjNGQlYrNEsJij8uT8fcB63DWhY0nk06Tade9TerpOhOI up0tE8YK2BRC4u4KwHpwEgXDI/awrFSljghxPReGnT6A3hXNfApmbC4JHyslEAx+kZjz zkqw== 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 :message-id:date:subject:cc:to:from; bh=r9JSZFtQxCEqKnvGvZQmMORw8fGi9Tlu+S1jhtS9Rjc=; b=KUXrtM7oHzYh1zly9lOeFn1En+3p3Do3kDMNj+0+KniTXkL1p8DZcODeWVhfR5JObl 1N/szW/c6SYHoIH/b0JxwJwnNv+0p5/7g2y3qKDrJdEg6Gb23YjjecbhSIMQsuz98hPe Bb15IAVEUGa80/ZGjYBEFUrPlxTq7JbhqnNRDN8Gmdhit7t0k35Ac9Xf7LtxupLF/6nV 8S0RtHWhm304GwQdg9vHZgBHEUHMuE5W/g+WO5PNq474jqHIPx00pxwiqKIx3T0GTkyP UIB7q8D5kV5XXsgLbuqbpnxoXucR76h/t0Rr5ssYDpRxMtVxwVW33vkUvvP1Nsg232n8 2oqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 31si10791796pgo.151.2019.06.17.04.59.49; Mon, 17 Jun 2019 04:59:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725763AbfFQL7s (ORCPT + 3 others); Mon, 17 Jun 2019 07:59:48 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:53163 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbfFQL7s (ORCPT ); Mon, 17 Jun 2019 07:59:48 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1Mq2vS-1iObZe1orS-00n8eA; Mon, 17 Jun 2019 13:59:32 +0200 From: Arnd Bergmann To: Herbert Xu , "David S. Miller" Cc: Arnd Bergmann , Eric Biggers , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: serpent - mark __serpent_setkey_sbox noinline Date: Mon, 17 Jun 2019 13:59:08 +0200 Message-Id: <20190617115927.3813471-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:nlRKSlHgvz2m3fKSfZ7wC9E0KZXX9jzM/z2eRxUPOPM/3xpzPV+ Zw3rBSyaQGObcrKRgaRZBxPqG/R0UConl0Iztg7s7WYIyKPn7P3/rl6YDLBpg4Wze3oViSl AbUC34gVy0QvoEIx7GO+gSyXbln6QnK7KQ1WhH6FQ5BIPcxQOnQdQojUzLZutskEY55LrCR uGptJwdiqTHn0XAHHUjdg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:3c/M2mR4H6w=:n/NbLMsUQ62zu8ZHsbJLcH zV+JBLdWrhAArxRLcX3E2VpK0xEiURubZba5QlXHF3JvBl0Q0Kp8G7vdEoJmSs5j0GwmkyL3o 5dRwdGPNWcrmWt11IU0WAvt8cK4T2ak8c3fwmzzQwEigCekU/h55VKvNYT24rgTm4iHX7PSk/ aWtRQjtrOOhUlt1PRfrRsf8trlX05V5N5kmsnRGRG/nOXy7B+I5bL4tmN6dx146S+mR96kxEu xAHrCf6ShdehcK/uXN/FgrCjlGEt6oYFupHkmfBS79w+oqq/BWGEh6lW0AjnGu4SJS+P58H0g gYXJ2pl4sxktGQQzhBzPDv3N++NFzsGTz5P63s+/rgx6SQhJkPw4OUajRd4KLKf/59sSnYglV m9CWbNbxZGmXdxhRujDksY/XLnnNGC8FTR+nZGq3n6MK83hCquDeGg1pj3CQ+lkxhalKbmI35 itORR+B7VGRpqd7WeQaLv1GvSO7GAubUgryDiq9WP3lPFnEas7Uw8CNpRgXQYBvE8BVRCrdOC x98PvOuwhSELH2Zlhjqc8rs14vUpvH/dyjLsvnyVYz6BCjc7EM4sGz8F/c7Y8T8T7iOIMoIC5 bAG/PXQL20Y4xzcr9qXgV1CZad8HrupmPF5v57TptwICd6UBUtRICj9RInHHNmwFWgYEEClmZ Tqgf8ubm98ekNFiEPD4hfSkBikODvaS9UB8yIeGwTFW00XXNkunUsTEXnhcTXbmXD3EQTDcgh 1rZ2etgkbKeTh0RQivoyC6fiipKJ3pYp9eygbQ== Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The same bug that gcc hit in the past is apparently now showing up with clang, which decides to inline __serpent_setkey_sbox: crypto/serpent_generic.c:268:5: error: stack frame size of 2112 bytes in function '__serpent_setkey' [-Werror,-Wframe-larger-than=] Marking it 'noinline' reduces the stack usage from 2112 bytes to 192 and 96 bytes, respectively, and seems to generate more useful object code. Fixes: c871c10e4ea7 ("crypto: serpent - improve __serpent_setkey with UBSAN") Signed-off-by: Arnd Bergmann --- crypto/serpent_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.0 diff --git a/crypto/serpent_generic.c b/crypto/serpent_generic.c index e57757904677..183661faf420 100644 --- a/crypto/serpent_generic.c +++ b/crypto/serpent_generic.c @@ -225,7 +225,7 @@ x4 ^= x2; \ }) -static void __serpent_setkey_sbox(u32 r0, u32 r1, u32 r2, u32 r3, u32 r4, u32 *k) +static void noinline __serpent_setkey_sbox(u32 r0, u32 r1, u32 r2, u32 r3, u32 r4, u32 *k) { k += 100; S3(r3, r4, r0, r1, r2); store_and_load_keys(r1, r2, r4, r3, 28, 24);