Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp892041pxu; Thu, 3 Dec 2020 15:38:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJz39lxmafBj4y0k8zC2Tonk1LjxSrk9hLIZqffoILykgshmS8SGyI/9x8A7j97kQ/9/mLrX X-Received: by 2002:a17:906:cec3:: with SMTP id si3mr4600725ejb.277.1607038720575; Thu, 03 Dec 2020 15:38:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607038720; cv=none; d=google.com; s=arc-20160816; b=cUm8sjE0tBp2wgqFliFLEX1QfD+s4wyV2xvouzLu4TkQwSdc3QqTrGHyuNgUe7mpwM 7sOn7ol+9nWJTJlUR+Dcvmw3lvzuszPKlk5CCdiFyiCsmVaD2/DQ2eY4+Ygh3JiG68rS OgMpNxL4VY+D2Zlp8x0suD/H/YjTkK8SSB623DTSSWNaDW2KgYDR7GhUJ+pr+4V8zMbM 2ZEcuHd5fEYeJmjN4AmXKzNV8zCDpaOlScXxTD1PS86ZoNgInYuzBmmiynMazfjQpwAA tysoEuz/K875E9yB0Rn7iJDVUwY//ESDX1JuXMkcACFTnPoZwGYnOCXQlZtJfBPzGhda NfTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=FVgoT08TG5YvAmWotKxqMBk0yHe89AS+W1UPWM1cCOU=; b=J9kuG9BNoIP074lLYfv59vgrWi132Ysuox4jxvyzt/uanhbOzXFJO2LSsgUXPEPuD0 0rltUuOuC4pOxzlLIWfVKETV5C2+XDqwybmZMkov7blYT0pnBfWJUuIAhq+Dc+FPkxS5 E0NtBFS2fvsnso23bwL5x85TZbuH15rfn2S4MPez9z3N+WSV8Ke3G8L9x/vYz20mqxEj gY+kmNnmrPBF6cxVv0Bzqp0pW4lhTeg4LJv3hoTBnejXnbmumW/rZwVy362HiZj6ZA52 WBXYwsd21oH1ouN1yhlMFk5eXdwgORJC6gwXY0yXcZ7z6ut+p8/tQneWm4GWyeWxoQvs ldTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=Mk7xKoKf; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k20si315272ejj.381.2020.12.03.15.38.09; Thu, 03 Dec 2020 15:38:40 -0800 (PST) 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; dkim=fail header.i=@linutronix.de header.s=2020 header.b=Mk7xKoKf; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728104AbgLCXes (ORCPT + 99 others); Thu, 3 Dec 2020 18:34:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729846AbgLCXes (ORCPT ); Thu, 3 Dec 2020 18:34:48 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C240C061A53; Thu, 3 Dec 2020 15:34:08 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1607038445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FVgoT08TG5YvAmWotKxqMBk0yHe89AS+W1UPWM1cCOU=; b=Mk7xKoKfyWCXtaFR+J6/WwO9YqNoUcAKE7Gf37tx2eOi9XndcwIib9aC8OI+iUU861Xh+w pnKoSApDWCirVMss6phNCwU4RP3p6SQwTjFSh5pkYl/YIr4bEi13YaYhi5u05Qx2r2+3hk eJze6siGQp7I594Xy8lZph0WpKnNNxGfefureAmF0jn2NrCgL83F0qjc7fm87DzCwBejgU DcKYRjbD/fU4txtsow+7HM+rycWgqp743Tilo3u92hs3PzEw+vWSIooMVb3RdoXj4iXYVX STtTAGp1ix5c2frRNHJTI6XB/QOvEt6SwuFw9D9hkar3a6OYSHz6SJetglsSYQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1607038445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FVgoT08TG5YvAmWotKxqMBk0yHe89AS+W1UPWM1cCOU=; b=Qcd9yBaZDFqngG0LovOd+mh+dCvYjY0RhGey/ZjUu4WH8jUPh+UcEx7LD+xvrATX1m22Fa pi2TKOE1zwPT3JDg== To: Corentin Labbe Cc: herbert@gondor.apana.org.au, mripard@kernel.org, wens@csie.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , linux-mm@kvack.org, Andrew Morton Subject: Re: crypto: sun4i-ss: error with kmap In-Reply-To: <20201203173846.GA16207@Red> References: <20201201130102.GA23461@Red> <87ft4phcyx.fsf@nanos.tec.linutronix.de> <20201201135252.GA9584@Red> <87y2ihfw6z.fsf@nanos.tec.linutronix.de> <20201201144529.GA6786@Red> <87v9dlfthf.fsf@nanos.tec.linutronix.de> <20201202195501.GA29296@Red> <877dpzexfr.fsf@nanos.tec.linutronix.de> <20201203173846.GA16207@Red> Date: Fri, 04 Dec 2020 00:34:05 +0100 Message-ID: <87r1o6bh1u.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Dec 03 2020 at 18:38, Corentin Labbe wrote: > On Wed, Dec 02, 2020 at 09:59:36PM +0100, Thomas Gleixner wrote: >> On Wed, Dec 02 2020 at 20:55, Corentin Labbe wrote: >> > On Tue, Dec 01, 2020 at 04:15:08PM +0100, Thomas Gleixner wrote: >> > >> > The result could be seen at http://kernel.montjoie.ovh/129768.log >> > The log is 9Mb, but the ftrace dump seems not terminated, tell me if you need more. >> >> Correct, the interesting entries right before the crash are missing. Can >> you try to make the trace buffers smaller or wait longer before >> terminating the thing? >> >> 16k buffer size per CPU should be completely sufficient. That should >> give us roughly the last 100 entries per CPU. >> >> 'trace_buf_size=16k' >> >> is the command line option for that. > > I have set a longer timeout and now the job end with the crash: > http://kernel.montjoie.ovh/130094.log Ok. So here is the problem: [ 996.933980] cryptset-316 0d..3 73943313us : __kmap_local_pfn_prot: kmap_local_pfn: 0 ffefe000 [ 996.943030] cryptset-316 0d..4 73943317us : __kmap_local_pfn_prot: kmap_local_pfn: 1 ffefd000 [ 996.952080] cryptset-316 0d..4 73943419us : kunmap_local_indexed: kunmap_local: 1 ffefe000 There are two maps: 1) index 0 vaddr 0xffefe000 2) index 1 vaddr 0xffefd000 Now comes the unmap and unmaps 0xffefe000 which is the first map and not the second one. -> Fail [ 74.017103] [] (kunmap_local_indexed) from [] (sg_miter_stop+0xb4/0x164) [ 74.025535] [] (sg_miter_stop) from [] (sg_miter_next+0xc/0xe4) [ 74.033191] [] (sg_miter_next) from [] (sun4i_ss_opti_poll+0x278/0x40c) [ 74.041539] [] (sun4i_ss_opti_poll) from [] (sun4i_ss_cipher_poll+0x4f4/0x5e4) [ 74.050497] [] (sun4i_ss_cipher_poll) from [] (crypto_skcipher_encrypt+0x38/0x5c) [ 74.059713] [] (crypto_skcipher_encrypt) from [] (xts_encrypt+0x8c/0xd4) [ 74.068146] [] (xts_encrypt) from [] (crypto_skcipher_encrypt+0x38/0x5c) [ 74.076581] [] (crypto_skcipher_encrypt) from [] (skcipher_recvmsg+0x364/0x43c) [ 74.085625] [] (skcipher_recvmsg) from [] (sock_read_iter+0xa8/0xf8) [ 74.093713] [] (sock_read_iter) from [] (vfs_read+0x2b8/0x2d8) [ 74.101279] [] (vfs_read) from [] (ksys_read+0xb0/0xe4) [ 74.108237] [] (ksys_read) from [] (ret_fast_syscall+0x0/0x58) The unmap comes from sg_miter_stop() and looking at the previous map/unmap cycles there are never nested maps. [ 996.943030] cryptset-316 0d..4 73943317us : __kmap_local_pfn_prot: kmap_local_pfn: 1 ffefd000 is the first event which allocates a nested map. So something goes south either in sg_miter or in the crypto maze. Enabling CONFIG_DEBUG_KMAP_LOCAL and function tracing might give us more clue. Thanks, tglx