From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70476C433EF for ; Fri, 17 Sep 2021 03:21:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5390660F8F for ; Fri, 17 Sep 2021 03:21:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243914AbhIQDXQ (ORCPT ); Thu, 16 Sep 2021 23:23:16 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:55258 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243767AbhIQDXQ (ORCPT ); Thu, 16 Sep 2021 23:23:16 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtp (Exim 4.92 #5 (Debian)) id 1mR4RW-0006Fs-ON; Fri, 17 Sep 2021 11:21:38 +0800 Received: from herbert by gondobar with local (Exim 4.92) (envelope-from ) id 1mR4RT-0001mt-5Z; Fri, 17 Sep 2021 11:21:35 +0800 Date: Fri, 17 Sep 2021 11:21:35 +0800 From: Herbert Xu To: Shreyansh Chouhan Cc: davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Carpenter Subject: Re: [PATCH] crypto: x86/aes-ni - check walk.nbytes instead of err Message-ID: <20210917032135.GI6559@gondor.apana.org.au> References: <20210911110759.40911-1-chouhan.shreyansh630@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210911110759.40911-1-chouhan.shreyansh630@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sat, Sep 11, 2021 at 04:37:59PM +0530, Shreyansh Chouhan wrote: > In the code for xts_crypt(), we check for the err value returned by > skcipher_walk_virt() and return from the function if it is non zero. > However, skcipher_walk_virt() can set walk.nbytes to 0, which would cause > us to call kernel_fpu_begin(), and then skip the kernel_fpu_end() call. > > This patch checks for the walk.nbytes value instead, and returns if > walk.nbytes is 0. This prevents us from calling kernel_fpu_begin() in > the first place and also covers the case of having a non zero err value > returned from skcipher_walk_virt(). > > Reported-by: Dan Carpenter > Signed-off-by: Shreyansh Chouhan > --- > arch/x86/crypto/aesni-intel_glue.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt