Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1753271rwb; Mon, 7 Nov 2022 05:30:33 -0800 (PST) X-Google-Smtp-Source: AMsMyM4A4fc4SuU/c5VS1WhJ82b+9BNRAix1LSw+Y3XnrsOIqRk6T9v2lvb5WqBVaw4PemVxpL7S X-Received: by 2002:a17:902:8212:b0:186:a260:50a0 with SMTP id x18-20020a170902821200b00186a26050a0mr50414077pln.157.1667827833310; Mon, 07 Nov 2022 05:30:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667827833; cv=none; d=google.com; s=arc-20160816; b=Kps8hGXyMg2h1EW6LU7ABf53/F9U+H9vU5sgq2yuvJaOMjMbPytC8Mhy+Lu8kRab1u +10MprdTfekW7JJEpBeBuk8VsgmxVM6YRIXLYYSu3rjWoX+nIcBnkKw7lO9uUjntEyo6 o9769PcjAsqdJquc0LnG95wLHWdzgiqIx/TwFAmeMZxTBA8dDp9CdQccVpS8JPct11U/ n846PUX2i6RuxfxxCQvT1XPDd5daoilnsl7g40Pj3dJX4yEz/21GYx+7H+KVwjY/fngU CC7t6mEebikPtbfFde6j/cgQ6/Z9co0H++680aHlf36e8CsTqbJoSbORYppMNugDt9ry LN5Q== 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=NElnXKjr6AanErxHP09033WIiyl9+C1c5/DbZnL9J1A=; b=GuF57VAmzftIokkI3A9QQwWT0K8CFjhK+AbHEu0C9VczrpInB5Dgro6uSrDJpxPRVN DopMI2NQoP/itHjV4cte4EjNVi1q/kMq8P89NKlN/fTWv2lMCXn6r+pAz6wYmPENhfMT Ap56ikGihlQAqjsvXSilQuJtItWwhWOXlVzwObbKj4i3wyrvI14d/poXBJL5U4KQcEge 4OJ+0Cp/uouTldZplAYWsSuv4LfM0k1hCQjeRo3mC69uIZ+qS7qU0p3oK1n7BHSLZNg3 YBNyHqWZf9nFMIrSGmh+72oF/9MHbn4VPMKhEnRdSjCcVdcBud3Uz1lRSfj4OK5RnImE rE9A== 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 u7-20020a170902a60700b00179faf5c34asi9648606plq.379.2022.11.07.05.30.13; Mon, 07 Nov 2022 05:30:33 -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 S231752AbiKGNW2 (ORCPT + 99 others); Mon, 7 Nov 2022 08:22:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231872AbiKGNW1 (ORCPT ); Mon, 7 Nov 2022 08:22:27 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C85971B78B; Mon, 7 Nov 2022 05:22:25 -0800 (PST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4N5WyY3J2TzpWDG; Mon, 7 Nov 2022 21:18:45 +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; Mon, 7 Nov 2022 21:22:23 +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; Mon, 7 Nov 2022 21:22:23 +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: Date: Mon, 7 Nov 2022 21:22:22 +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: dggems701-chm.china.huawei.com (10.3.19.178) 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/4 17:08, Herbert Xu wrote: > On Sat, Oct 29, 2022 at 09:25:18AM +0800, liulongfang wrote: >> >> The context of the problem may not have been clearly stated in the previous >> description. >> >> This is a problem found in one of our real user scenarios: >> In this scenario of using an accelerator to perform encryption services, >> it was originally intended to use the CPU to perform encryption services >> in synchronous mode (without loading the hardware device driver, and without >> registering the asynchronous callback function), but due to a deployment >> error, the Hisi hardware device driver was loaded into the system, >> this wrong operation causes the encryption service to call the device >> driver of the hisi hardware, but the hardware device driver executes the >> asynchronous mode, so the callback interface is called after the service >> is completed. >> This leads to this system calltrace problem. >> >> The purpose of this patch is to ensure that the device does not appear >> calltrace in this abnormal situation. > > I'm still having trouble understanding this. Please give an > exact call-trace that triggers the callback with a NULL callback > pointer. > What do you need is the log of this call trace? Kernel log: Workqueue: 0000:76:00.0 qm_work_process [hisi_qm] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : 0x0 lr : sec_skcipher_callback+0x108/0x140 [hisi_sec2] sp : ffff80002cda3cb0 x29: ffff80002cda3cb0 x28: ffff0020a9a56080 x27: ffff2040076a4800 x26: 0000000000000000 x25: dead000000000100 x24: dead000000000122 x23: ffff0020881eb4d0 x22: ffff0020960c6f00 x21: ffff0020881eb4b0 x20: ffff0020881eb478 x19: ffff2040076a4880 x18: 000000000000001c x17: 00000000a3f246e1 x16: ffffb38bc5e73d40 x15: 000000006c63877d x14: 0000000000000000 x13: 0000000000000000 x12: ffff2040063b1dd0 x11: ffff2040063b1da8 x10: ffff2040063b1da8 x9 : ffffb38b8da71f78 x8 : ffff2040063b1dd0 x7 : 0000000000000000 x6 : ffff2040063b1fd0 x5 : 0000000000000228 x4 : 0000000000000000 x3 : ffff00209ba33000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff2040076a4820 Call trace: 0x0 sec_req_cb+0xc8/0x254 [hisi_sec2] qm_work_process+0x1d8/0x330 [hisi_qm] process_one_work+0x1e0/0x450 worker_thread+0x158/0x450 kthread+0x118/0x120 ret_from_fork+0x10/0x20 Code: bad PC value ---[ end trace 0000000000000000 ]--- > Thanks, > Thanks, Longfang.