Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp935457pxv; Thu, 1 Jul 2021 12:42:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN2e+cc1R9lzL9Q8Hv9mnLMbr3h58tCWLws71DWckD45uQeAR/10zFE/oVHlCn3SG+jvgR X-Received: by 2002:a5e:dc48:: with SMTP id s8mr793401iop.71.1625168542591; Thu, 01 Jul 2021 12:42:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625168542; cv=none; d=google.com; s=arc-20160816; b=s+PX96AUgvr5W944CnODqpMfbf1rfCNOWwmhAZECqM5/BypETFqXhkv80F+GOht3sF Je6cpZ5fjoLjxr1EAXOtiWu1RHqYkEgUvBCTJEUvnTuLnquyL1dJKYKiclTMkHuzXra1 mTk1+D2FZnUYpOi2at+jYjdAjmCie4cpTuh94aHjlwTGYPUw5gOsm60669v3PkTaM+mG g916gH+SKogwIz91AwnzQevxW6Fj9d9k6Fp/hltAX2JXV0/CwSeOCZeDWjaoCDBH5Meg M9ysUqVl/6aU/AA/s0aAvv7wMI9juc7uYtQ0pH2KV50bS7yi+pby8SMaZa0t2fRD3PJv 1bgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=ldsxOWJ+V9FdjktrGevGiDZpGeXESKZFjg0tbZnyHw8=; b=d3rSH1usnQ0fa0BEkrVGNg15IMTKdykpXR+ltL/L1beZ4O1dha9l+aclH7kbfXaVYI Cu/MV/XeJu/wxuHfmOIeYV/lmiI+nBUC5DpnEmD80MKgaa9cQr7Av7aubOmBVoWSv/pn B5YJRvMreo4c0HvqoHGTzowjmr97xOr5RkskU5lX+weyb52O+TvOocROiefMmfnMTWHP eaeRsZMOztUKW3n8Qt8N4ZJA4qxwP7YEcQlMUCZBQBwT3lnL1db1N7rSLw6FQVc/jrzM nZGwq5/l5eQnSyNk4oem/dGY8dbcoxosXNBhGlCuGMZQgbY826QK2s3yYIjdN5J4FdrD /4cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si833045ioq.17.2021.07.01.12.42.00; Thu, 01 Jul 2021 12:42:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233223AbhGAThC convert rfc822-to-8bit (ORCPT + 99 others); Thu, 1 Jul 2021 15:37:02 -0400 Received: from lithops.sigma-star.at ([195.201.40.130]:50262 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbhGAThB (ORCPT ); Thu, 1 Jul 2021 15:37:01 -0400 X-Greylist: delayed 349 seconds by postgrey-1.27 at vger.kernel.org; Thu, 01 Jul 2021 15:37:01 EDT Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id EAE436108188; Thu, 1 Jul 2021 21:28:40 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Cu2fSJkVVSEt; Thu, 1 Jul 2021 21:28:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 20775610848B; Thu, 1 Jul 2021 21:28:40 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id cVnxTMQBKNSC; Thu, 1 Jul 2021 21:28:40 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id EBAA06108478; Thu, 1 Jul 2021 21:28:39 +0200 (CEST) Date: Thu, 1 Jul 2021 21:28:39 +0200 (CEST) From: Richard Weinberger To: Sean Anderson Cc: Linux Crypto Mailing List , Herbert Xu , davem , horia geanta , aymen sghaier , linux-arm-kernel , Marek Vasut , david Message-ID: <723802567.13207.1625167719840.JavaMail.zimbra@nod.at> In-Reply-To: <20210701185638.3437487-1-sean.anderson@seco.com> References: <20210701185638.3437487-1-sean.anderson@seco.com> Subject: Re: [PATCH v2 0/2] crypto: mxs_dcp: Fix an Oops on i.MX6ULL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF78 (Linux)/8.8.12_GA_3809) Thread-Topic: crypto: mxs_dcp: Fix an Oops on i.MX6ULL Thread-Index: IWrviunujKG/v99nyBJ/3UbF2cACPA== Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Sean, [CC'ing David] ----- Ursprüngliche Mail ----- > Von: "Sean Anderson" > An: "Linux Crypto Mailing List" , "Herbert Xu" , "davem" > > CC: "horia geanta" , "aymen sghaier" , "richard" , > "linux-arm-kernel" , "Marek Vasut" , "Sean Anderson" > > Gesendet: Donnerstag, 1. Juli 2021 20:56:36 > Betreff: [PATCH v2 0/2] crypto: mxs_dcp: Fix an Oops on i.MX6ULL > This fixes at least one oops when using the DCP on ULL. However, I got > another Oops when running kcapi-dgst-test.sh from the libkcapi test > suite [1]: > > [ 6961.181777] Unable to handle kernel NULL pointer dereference at virtual > address 000008f8 > [ 6961.190143] pgd = e59542a6 > [ 6961.192917] [000008f8] *pgd=00000000 > [ 6961.196586] Internal error: Oops: 5 [#1] ARM > [ 6961.200877] Modules linked in: crypto_user mxs_dcp cfg80211 rfkill > des_generic libdes arc4 libarc4 cbc ecb algif_skcipher sha256_generic libsha256 > sha1_generic hmac aes_generic libaes cmac sha512_generic md5 md4 algif_hash > af_alg i2c_imx ci_hdrc_imx ci_hdrc i2c_core ulpi roles udc_core imx_sdma > usb_common firmware_class usbmisc_imx virt_dma phy_mxs_usb nf_tables nfnetlink > ip_tables x_tables ipv6 autofs4 [last unloaded: mxs_dcp] > [ 6961.239228] CPU: 0 PID: 469 Comm: mxs_dcp_chan/ae Not tainted > 5.10.46-315-tiago #315 > [ 6961.246988] Hardware name: Freescale i.MX6 Ultralite (Device Tree) > [ 6961.253201] PC is at memcpy+0xc0/0x330 > [ 6961.256993] LR is at dcp_chan_thread_aes+0x220/0x94c [mxs_dcp] > [ 6961.262847] pc : [] lr : [] psr: 800e0013 > [ 6961.269130] sp : cdc09ef4 ip : 00000010 fp : c36e5808 > [ 6961.274370] r10: cdcc3150 r9 : 00000000 r8 : bff46000 > [ 6961.279613] r7 : c36e59d0 r6 : c2e42840 r5 : cdcc3140 r4 : 00000001 > [ 6961.286156] r3 : 000008f9 r2 : 80000000 r1 : 000008f8 r0 : cdc1004f > [ 6961.292704] Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none > [ 6961.299860] Control: 10c53c7d Table: 83358059 DAC: 00000051 > [ 6961.305628] Process mxs_dcp_chan/ae (pid: 469, stack limit = 0xe1efdc80) > [ 6961.312346] Stack: (0xcdc09ef4 to 0xcdc0a000) > [ 6961.316726] 9ee0: cdc1004f > 00000001 bf13cda4 > [ 6961.324930] 9f00: 00000000 00000000 c23b41a0 00000000 c36e59d0 00000001 > 00000010 00000000 > [ 6961.333132] 9f20: 00000000 00000000 c13de2fc 000008f9 8dc13080 00000010 > cdcc3150 c21e5010 > [ 6961.341335] 9f40: cdc08000 cdc10040 00000001 bf13fa40 cdc11040 c2e42880 > 00000002 cc861440 > [ 6961.349535] 9f60: ffffe000 c33dbe00 c332cb40 cdc08000 00000000 bf13cb84 > 00000000 c3353c54 > [ 6961.357736] 9f80: c33dbe44 c0140d34 cdc08000 c332cb40 c0140c00 00000000 > 00000000 00000000 > [ 6961.365936] 9fa0: 00000000 00000000 00000000 c0100114 00000000 00000000 > 00000000 00000000 > [ 6961.374138] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 > [ 6961.382338] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 > 00000000 00000000 > [ 6961.390567] [] (memcpy) from [] > (dcp_chan_thread_aes+0x220/0x94c [mxs_dcp]) > [ 6961.399312] [] (dcp_chan_thread_aes [mxs_dcp]) from [] > (kthread+0x134/0x160) > [ 6961.408137] [] (kthread) from [] > (ret_from_fork+0x14/0x20) > [ 6961.415377] Exception stack(0xcdc09fb0 to 0xcdc09ff8) > [ 6961.420448] 9fa0: 00000000 00000000 > 00000000 00000000 > [ 6961.428647] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 > [ 6961.436845] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 > [ 6961.443488] Code: e4808004 e480e004 e8bd01e0 e1b02f82 (14d13001) > > where dcp_chan_thread_aes+0x220 is the line > > memcpy(in_buf + actx->fill, src_buf, clen); > > in mxs_dcp_aes_block_crypt. I also tried with the following patch > instead of the one included in this series: > > --- > diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c > index f397cc5bf102..54fd24ba1261 100644 > --- a/drivers/crypto/mxs-dcp.c > +++ b/drivers/crypto/mxs-dcp.c > @@ -367,6 +367,7 @@ static int mxs_dcp_aes_block_crypt(struct > crypto_async_request *arq) > last_out_len = actx->fill; > while (dst && actx->fill) { > if (!split) { > + kmap(sg_page(dst)); > dst_buf = sg_virt(dst); > dst_off = 0; > } > @@ -379,6 +380,7 @@ static int mxs_dcp_aes_block_crypt(struct > crypto_async_request *arq) > actx->fill -= rem; > > if (dst_off == sg_dma_len(dst)) { > + kunmap(sg_page(dst)); > dst = sg_next(dst); > split = 0; > } else { > -- > > but got the same oops. Unfortunately, I don't have the time to > investigate this oops as well. I'd appreciate if anyone else using this > device could look into this and see if they encounter the same errors. > > [1] https://github.com/smuellerDD/libkcapi/blob/master/test/kcapi-dgst-test.sh Can you please share your kernel .config? David or I can test on our test bed. But will take a few days. Thanks, //richard