Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1421135rwb; Wed, 9 Nov 2022 18:05:30 -0800 (PST) X-Google-Smtp-Source: AMsMyM6CblzmyFZT+V8ySDuDuj1GfG7NGtfdpcXge3NqtgR5IuQLRnjzYR65vFjFbNtZNyIlAaX4 X-Received: by 2002:aa7:959d:0:b0:56d:27ac:778 with SMTP id z29-20020aa7959d000000b0056d27ac0778mr60120194pfj.29.1668045929999; Wed, 09 Nov 2022 18:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668045929; cv=none; d=google.com; s=arc-20160816; b=FqtYnFo77DyR3kSpnAU6EYMRQuECrx4AurtZNv1qMdG6vWUIIChL8Op+KLxZyFC4KR YZ8UpdtWlYF+bA3fQznOpXeTYcDHm2WOrJ7W1FibOL44oCgQU1AhuO4fR+697JGIdB9y jfSMzu3dv4pqChyzZdkcnUFKZrluy8LNvHs65A8pBXEcxoaqB2Iv8G/JX7VP8rgw82ND SvUTI+G3Aqj5R+SAdHD3w7E4cczlA+svPbOU6gjeJ2IpMc/gdGK0jEDeVWJQzUkXYXZq FQUmKsb47ykfcH+FZrv9u6ZE1GyIIB97XlEmV7Ju9phLXEwJRqs9WWbLsm7FrBqatyDU SYeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=QIw64xtuckR4tBYFk6vOkz9hKx9sXW9gU++6XABGoZQ=; b=LEVt/JA2306xnmDiuye0v0wKxmBOMMsbtJcdXeRR4UhF9Lw5zWN1fp1IxFbfFnLN8T lSZdTkRDJ+s+nF3SmYf1bjwEZwAHzIaLGBvDAKvppPOlYSGaH5Bpj5drimBYuHUn5hT7 DAnzZJmJDtj9kgZ8BtrLqYb9nKPFwIrZcNrm1hj5YhsCXpdz+yUoxjZwvhJ/L2UlgOMM hpvQIdJ/03fY8uZMUheH1VsXsi7W8X6+u8zRfz1FDwOsaaPeCYpdgevAzvW+1EdNYuKW A+BkTzgbsD0gicJfIv9WPB3nSF6GkeqvDoxONdN9yhc66xuWi82pLRUKpMjgd5PPWXnn cnnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e18-20020a630f12000000b0041bfb11f138si18946313pgl.442.2022.11.09.18.05.08; Wed, 09 Nov 2022 18:05:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232426AbiKJCEm (ORCPT + 99 others); Wed, 9 Nov 2022 21:04:42 -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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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, >