Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp74246rwb; Wed, 9 Nov 2022 20:14:21 -0800 (PST) X-Google-Smtp-Source: AMsMyM7udcH1/QtP/Kq7HKohaOUHr8z7wLTJXb1/chZAdNLBc1uWAz3H5iVFFDd+zMjojkB/G3i7 X-Received: by 2002:a05:6a00:1a44:b0:52a:ecd5:bbef with SMTP id h4-20020a056a001a4400b0052aecd5bbefmr62098757pfv.28.1668053660895; Wed, 09 Nov 2022 20:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668053660; cv=none; d=google.com; s=arc-20160816; b=ExP/ipNRDSphBNwipnWAhu58MBA9gWuKVOQJB+CPruDL1RTyibTGNGa/9Y8PmdnCA1 u26965hhOKZZ6ZQgCYrvzVkn/DpUvr3BMU+LYU/Bsx+2I5i1rRAsFoR6YYIr2wcTXgny +2YH63yjzt10oI4vNoXx+cxce2j2siNiHF+1Ty/jpI7Slu2/jiPk6YtAdQqdsHUB4vq9 AeVq0yrJcCWkxmxsfMSnwb2ELlvnqaKJT0KRmfd77HHcThmKsLOzy2m/of8XArhJVFtO VOe1UUk4qeHC2GhPolvOTuWPwwKb2VJmD3U/VQLfaC3+hzEY1u6UyVrcf9Z669wwEf7g V+Gw== 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=27TPsWUCn1n19oHk3uW3wEOREcLZHW0OliWFuiQPUJI=; b=dBYzEhHZf+8aRaDKNmZEP4raB2m35ALa+q8nwAeA5A9zZqTK3mlfTmcwb7r+SPT/BE qg28w2YkOBED/qS2DEA+5AfNRiSw/12HnKilo9TLUyBpUwEnQtWgZp1XSY+ODfrVJVsv kMNDS6ZXO8Fmn0heOHmn+T8KBENIfSW2WOxSQhjnaPDwBllW58eUWG+Kdatk5n7CI2RG 58/LHMCpRKFR2RZqAdERKLNZ2eSWmsrArPeVte7ZI36TJPkgKFOwYGPAcwAuplfC+/gh 96SqXwriHcUZ4xWwh5wegZh1h9BEReYIuKaZAASQtKdjjfCQhDmgmul1T9/d9gSYQ5On x65A== 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 f9-20020a63f109000000b004349119ea7bsi4327168pgi.401.2022.11.09.20.13.38; Wed, 09 Nov 2022 20:14:20 -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 S232367AbiKJENR (ORCPT + 99 others); Wed, 9 Nov 2022 23:13:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232398AbiKJEMh (ORCPT ); Wed, 9 Nov 2022 23:12:37 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D31F5303FB; Wed, 9 Nov 2022 20:11:18 -0800 (PST) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4N77gC4f1Nz15MPv; Thu, 10 Nov 2022 12:11:03 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv704-chm.china.huawei.com (10.3.19.47) 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 12:11:16 +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 12:11:16 +0800 Subject: Re: [PATCH] crypto/hisilicon: Add null judgment to the callback interface To: Herbert Xu CC: , , References: <717adf23-3080-5041-14ed-6ab5dcaddbf9@huawei.com> <32686c5b-04b2-7103-bf2e-113db2315ef4@huawei.com> From: liulongfang Message-ID: <40a0e7aa-362a-0de7-76c0-77381c07f254@huawei.com> Date: Thu, 10 Nov 2022 12:11:15 +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: dggems702-chm.china.huawei.com (10.3.19.179) 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/10 11:20, Herbert Xu wrote: > On Thu, Nov 10, 2022 at 10:03:53AM +0800, liulongfang wrote: > . >> 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), > > Are you saying this requires out-of-tree kernel code to trigger? > Yes, this problem is triggered by application layer code, but it happens on kernel driver code. > Then you should fix that out-of-tree code. > When using crypto's skcipher series interfaces for encryption and decryption services, User can use synchronous mode(by adjusting some skcipher interfaces, here is to remove skcipher_request_set_callback()) or asynchronous mode, but when using synchronous mode and the current asynchronous mode is loaded it will cause a calltrace. The current problem is that the interface of skcipher does not restrict users to call functions in this way for encryption services. If the current driver doesn't handle this, there is a possibility that some users deliberately create this kind of problem to cause the kernel to crash. > Thanks, >