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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AD7DC4332F for ; Thu, 10 Nov 2022 02:04:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232528AbiKJCEp (ORCPT ); Wed, 9 Nov 2022 21:04:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232530AbiKJCE2 (ORCPT ); Wed, 9 Nov 2022 21:04:28 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8731F27B35; Wed, 9 Nov 2022 18:03:56 -0800 (PST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N74rJ5g41zRp2Z; Thu, 10 Nov 2022 10:03:44 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 10:03:54 +0800 Received: from [10.67.103.158] (10.67.103.158) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 10:03:54 +0800 Subject: Re: [PATCH] crypto/hisilicon: Add null judgment to the callback interface To: Herbert Xu CC: , , References: <20220930024320.29922-1-liulongfang@huawei.com> <717adf23-3080-5041-14ed-6ab5dcaddbf9@huawei.com> From: liulongfang Message-ID: <32686c5b-04b2-7103-bf2e-113db2315ef4@huawei.com> Date: Thu, 10 Nov 2022 10:03:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.158] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/11/9 17:18, Herbert Xu wrote: > On Wed, Nov 09, 2022 at 02:21:11PM +0800, liulongfang wrote: >> >> The trigger method is to not call the function skcipher_request_set_callback() >> when using the skcipher interface for encryption and decryption services. > > Yes but which function exactly? Please give the exact call path > leading to this crash. > This problem occurs in the application code of the encryption usage scenario (unfortunately, these codes are not open to the public and cannot be given to you), but its code logic is similar to test_skcipher_vec_cfg() in kernel\crypto\testmgr.c, and it is also in accordance with this call logic execution: crypto_alloc_skcipher()--->skcipher_request_alloc()--->crypto_skcipher_setkey()---> sg_init_table()--->skcipher_request_set_crypt()---> crypto_skcipher_encrypt()/crypto_skcipher_decrypt()---> skcipher_request_free()--->crypto_free_skcipher() Just don't add "wait" and skcipher_request_set_callback(), use it as a synchronous mode. Thanks Longfang. > Cheers, >