Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2050206imm; Mon, 16 Jul 2018 00:56:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeIRKfvcHa1aDBNPN1/FZTWNhjqBVwJXdxrEv15ef9Cs52hWQUVOTPE99QdP74bb8FvXY0U X-Received: by 2002:a63:7703:: with SMTP id s3-v6mr14815609pgc.339.1531727805570; Mon, 16 Jul 2018 00:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727805; cv=none; d=google.com; s=arc-20160816; b=JDmVvkNdGYG7L7gFWP08egyHkzJMFZjitU6NevcoS9DUC2CfzlKTSc5s3auXt7t2Fv NayZpEn/vSAYs2HveZ7I/rnhco2QRjtrg4IQ/X9m5D4f8Xi23Ym6bHUEBI4LPFh4hj4M L+sIHybkpk74n6/WB0WNlfEBTBVJr7Qt4F39l4+CNI79GhPN1ylMs6m0F2Xjxju9C7AS FGjqyGvOmHncdBlZ6HEC8CvQCopX0G6INoiLCgOCfX00VOCaOz2uXNT8E1iYh+yT3GYf BzSKNXY5HJT+i605GKXe7rpgZF5HASDAR3nQ+MefN5EDVZ784DAODoBI5KHl9hycLpC3 4PPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=awx9oop1F5B0kxWd08hAMRnYUAVa2ma7kvKgJ8QALGc=; b=z5TaeX7gz7/5dPo/jaXbkN+pcw3If7J9Mh6ec4tJCIQOWJ9wJbC8anWIiyGPI+BHb5 TWTU9/CRWBSJpCAfOE2HN7bJKgxSRf1EhE/RHsRzTtN/F0AynLsmGx1sD8UI5CjJ3C7j m9G3l/xVR2pGfcAnFogWtefdAJolxYlmw3q7hJaHDj9EZtyZ1U8YMpzTVnhmU7hDlMBK FB/KCDTHcWohAh7yQTwFxeabDqc4br5WSGUciYS6tyqdogXcZQ5wG2Ib4jzPHRs+qL/s owgzoHOLAm7Hlimlg8Uett74yz6yAAFxU78ANx98cuF0x++UP+MJOJszxqYrqytXbGY5 fDoQ== ARC-Authentication-Results: i=1; mx.google.com; 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 a7-v6si27393339pgt.495.2018.07.16.00.56.30; Mon, 16 Jul 2018 00:56:45 -0700 (PDT) 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; 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 S1730816AbeGPIFe (ORCPT + 99 others); Mon, 16 Jul 2018 04:05:34 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47144 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbeGPIFb (ORCPT ); Mon, 16 Jul 2018 04:05:31 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C6850CA1; Mon, 16 Jul 2018 07:39:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Vyukov , syzbot+37035ccfa9a0a017ffcf@syzkaller.appspotmail.com, syzbot+e073e4740cfbb3ae200b@syzkaller.appspotmail.com, linux-crypto@vger.kernel.org, "David S. Miller" , Herbert Xu , Ard Biesheuvel Subject: [PATCH 4.17 55/67] crypto: dont optimize keccakf() Date: Mon, 16 Jul 2018 09:35:24 +0200 Message-Id: <20180716073452.383199246@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Vyukov commit f044a84e040b85cd609851ac88ae8b54b2cc0b75 upstream. keccakf() is the only function in kernel that uses __optimize() macro. __optimize() breaks frame pointer unwinder as optimized code uses RBP, and amusingly this always lead to degraded performance as gcc does not inline across different optimizations levels, so keccakf() wasn't inlined into its callers and keccakf_round() wasn't inlined into keccakf(). Drop __optimize() to resolve both problems. Signed-off-by: Dmitry Vyukov Fixes: 83dee2ce1ae7 ("crypto: sha3-generic - rewrite KECCAK transform to help the compiler optimize") Reported-by: syzbot+37035ccfa9a0a017ffcf@syzkaller.appspotmail.com Reported-by: syzbot+e073e4740cfbb3ae200b@syzkaller.appspotmail.com Cc: linux-crypto@vger.kernel.org Cc: "David S. Miller" Cc: Herbert Xu Cc: Ard Biesheuvel Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/sha3_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/crypto/sha3_generic.c +++ b/crypto/sha3_generic.c @@ -152,7 +152,7 @@ static SHA3_INLINE void keccakf_round(u6 st[24] ^= bc[ 4]; } -static void __optimize("O3") keccakf(u64 st[25]) +static void keccakf(u64 st[25]) { int round;