Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp84029pxb; Tue, 21 Sep 2021 19:30:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzv2LqdNtyfXq9qJq7AkYm9iZpqnus0Wy1rR/8qhHec4tE9Z2aOj+o6cWcEJUugu4gur0ZN X-Received: by 2002:a92:cecf:: with SMTP id z15mr23735425ilq.96.1632277826816; Tue, 21 Sep 2021 19:30:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632277826; cv=none; d=google.com; s=arc-20160816; b=i9yRACMkGFOBDuYbquPnkYiro65NKz6b9pXTghBbb4/blsZGPBn9mOdkKAODvYxfGu dCDsvFsfonhV4VxKb0gnTITjyoCe4B+sYJIJi4VkX0BOLgKl+d6vezyYpTg+vK+54XM0 fLWD3sPPDdGq/Hvl5OgvZbx44ri08hmI1GBNnXKt+zGTkKI1oq1KEO4ld5vSnj/PXo1K ckGhB9Uwc7shtQ9Y/uM+RzDpqf2TT+johiqgPe1yHDWszxFwjrp2/SEeGAvfG72gol9i apcTIuYQOs3r63yCGSaxDRFFieREMfG2PjwF7VecVpxgojU6G1Eq7nnTvCADU0xCxbx3 jwiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=J0QVKuWKouQFMFf8LGD3Z4Xk+ABYICk5bSFUnYV02pY=; b=MO8CBNSmAo72vk4y0FdqJMcOHKcc9zIJmMOL19pqAdXBNWsYcoQxhQUN7TqsHqonlV WJAndUpGrDp29DtB+Ws6ZMye71BHMrQ9e0TzbDucrsDjkt3NIgevun4oJ9lmBc7eL0tA O5H6W9RvN1xHJdQnAIPPSuVOP2wgb1CqS9Zyos1lc2Tol6LdJpsoluuGo3A8fcMd58jw z3hEpIWjYEzmowe5YhNSDw0tGgoq5kRvNma1g0/lqX2cnhw0h11KRov3kMnetD7EGAT3 8MvkUnhQ/llnWfaTgE9+3R+dCMEUW4sivRMqjNHw93ELM51kzlVtzAmvJa9QgY8ZDVa2 lGsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si958485ilh.180.2021.09.21.19.30.15; Tue, 21 Sep 2021 19:30:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbhIVCad (ORCPT + 99 others); Tue, 21 Sep 2021 22:30:33 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:52889 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229465AbhIVCac (ORCPT ); Tue, 21 Sep 2021 22:30:32 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0UpB2F3U_1632277730; Received: from B-455UMD6M-2027.local(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0UpB2F3U_1632277730) by smtp.aliyun-inc.com(127.0.0.1); Wed, 22 Sep 2021 10:28:51 +0800 Subject: Re: [linux-next:master 3857/7963] arch/x86/crypto/sm4-aesni-avx-asm_64.o: warning: objtool: sm4_aesni_avx_crypt8()+0x8: sibling call from callable instruction with modified stack frame To: Josh Poimboeuf , Arnd Bergmann Cc: kernel test robot , kbuild-all@lists.01.org, clang-built-linux , Peter Zijlstra , Linux Kernel Mailing List , Herbert Xu References: <202108160330.T1EbbpCi-lkp@intel.com> <20210920175656.cjvrr4wn7a3k6tnx@treble> From: Tianjia Zhang Message-ID: <6d49d3ba-ae5d-cd57-d1fb-d9df5b859cbe@linux.alibaba.com> Date: Wed, 22 Sep 2021 10:28:49 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210920175656.cjvrr4wn7a3k6tnx@treble> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/21/21 1:56 AM, Josh Poimboeuf wrote: > From: Josh Poimboeuf > Subject: [PATCH] x86/crypto/sm4: Fix frame pointer stack corruption > > sm4_aesni_avx_crypt8() sets up the frame pointer (which includes pushing > RBP) before doing a conditional sibling call to sm4_aesni_avx_crypt4(), > which sets up an additional frame pointer. Things will not go well when > sm4_aesni_avx_crypt4() pops only the innermost single frame pointer and > then tries to return to the outermost frame pointer. > > Sibling calls need to occur with an empty stack frame. Do the > conditional sibling call *before* setting up the stack pointer. > > This fixes the following warning: > > arch/x86/crypto/sm4-aesni-avx-asm_64.o: warning: objtool: sm4_aesni_avx_crypt8()+0x8: sibling call from callable instruction with modified stack frame > > Fixes: a7ee22ee1445 ("crypto: x86/sm4 - add AES-NI/AVX/x86_64 implementation") > Reported-by: kernel test robot > Reported-by: Arnd Bergmann > Signed-off-by: Josh Poimboeuf Thanks for your fix. Reviewed-by: Tianjia Zhang Thanks. > --- > arch/x86/crypto/sm4-aesni-avx-asm_64.S | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/crypto/sm4-aesni-avx-asm_64.S b/arch/x86/crypto/sm4-aesni-avx-asm_64.S > index fa2c3f50aecb..a50df13de222 100644 > --- a/arch/x86/crypto/sm4-aesni-avx-asm_64.S > +++ b/arch/x86/crypto/sm4-aesni-avx-asm_64.S > @@ -367,10 +367,12 @@ SYM_FUNC_START(sm4_aesni_avx_crypt8) > * %rdx: src (1..8 blocks) > * %rcx: num blocks (1..8) > */ > - FRAME_BEGIN > > cmpq $5, %rcx; > jb sm4_aesni_avx_crypt4; > + > + FRAME_BEGIN > + > vmovdqu (0 * 16)(%rdx), RA0; > vmovdqu (1 * 16)(%rdx), RA1; > vmovdqu (2 * 16)(%rdx), RA2; >