Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2027271pxu; Sun, 6 Dec 2020 16:19:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyi+I6ZzRD+CHIXLSInOuKUfgJeyWIDB2/BiV+urthbicI8ymJ6uoHws6nELuNZ3gzulohU X-Received: by 2002:a05:6402:1d18:: with SMTP id dg24mr17277870edb.221.1607300371582; Sun, 06 Dec 2020 16:19:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607300371; cv=none; d=google.com; s=arc-20160816; b=VBfgH/b/DsnOuKs0u8kqN/UIwb9sNsp/Nl/CjcRacktM0fC2xHmfhwpFhi340V9YOK gMO0JehN47LXcUovBxSf5unFVaSvjv/9og/cFGQoQXDgvCvh39/f0N1RWYuE3re2BhSu EzRiLiesH+8yRSYTMu19IUYJcScHicmmAWC9G+Mwb8EzBze8YuVgUXBVLjbbJLPOPivP 8C8R4RIdMarNWwAAAkDngTwv4gozPQq0GCk5QP3aBJqm5HKRj+QUDqVX3bF003s1zkvU GtsNnAQG9a6f+0PM1UKHPwWti/3gXMQAylz8/DlnhKMSnZAcR9iYeVEqoLTapKNtOrni F4Aw== 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=Ws2ScGMjp86jp8aHAXXrqSbAWewd2teUNridlmZ/6nU=; b=vA2rAfMvAhhEmoj3hyxCyM6LZ2YzDOwFx9qRis+JiOWnYt7b5xptMw7xBDR32YqHtQ 6jFzoJSP82PHr7yNk8ZJT2VqDzG9BERIyafXKzleil/OmeRQaUb7DLF9ALzp/onJTc2S FUCz0yKxDdIig8O805tUdU5S/1qVKCthq0uHSGjt6ejkDnfBQBMnmKyHb1zYA+qwkJiJ jM/4AJt/Q8vv2nnoAIqdagVDw0BEWlBuuDY42P0TebryZKjW+ab+jUBLtaJXDsOjjzV4 rKCa/7H7mXxeJn4SZkT562j9L7dLrBTQLq/1E4GSd9/qZwdAVi9MFWOn/QojI8l3yZc+ MKDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=hObnEdDA; 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 p9si6038611edq.97.2020.12.06.16.18.53; Sun, 06 Dec 2020 16:19:31 -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=hObnEdDA; 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 S1726858AbgLGAQc (ORCPT + 99 others); Sun, 6 Dec 2020 19:16:32 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:32932 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbgLGAQb (ORCPT ); Sun, 6 Dec 2020 19:16:31 -0500 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1607300149; 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=Ws2ScGMjp86jp8aHAXXrqSbAWewd2teUNridlmZ/6nU=; b=hObnEdDAUiea928sQD8eEjcFoa7xTGkA5Wrk+UrTBzGfk+TftgXZSxaS4mbNZaIMnV9LWw h051BZDdNBMI5F6ltSchjzct4Cz0uwC4TSi/9tbxzpGOsQ6PtbFvKpeL0SPFFKA9I3kgiM xNVHO/oiee+l3R/Stfmrdb5gnuMgBTpU7//9PAuTJRZ5EPQUPutDwdpNDAp0AwBpXzuXZW eHAeEKkHAW2x4oQ0XhMtAAxvBi2A7BBySb5/4nFB05gVF86Yo6aEfwu4xrauBxu2eo2vbY Kg3m8wbG2dhN9OVq3UDeKVUu/AUZ5kbhbf39aoLEawU8ZMQZo3xA39WZa99w7Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1607300149; 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=Ws2ScGMjp86jp8aHAXXrqSbAWewd2teUNridlmZ/6nU=; b=dSiJdSaW9yvM0UV8QDwe4Y4I1tZqsK8VBGlAz+ESmfKIGhPFx3824WD/vZfGjE35osK2Ob a6xKQVyNOhNAJFDQ== 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 , Julia Lawall , Matthew Wilcox Subject: Re: crypto: sun4i-ss: error with kmap In-Reply-To: <20201206214053.GA8458@Red> References: <20201202195501.GA29296@Red> <877dpzexfr.fsf@nanos.tec.linutronix.de> <20201203173846.GA16207@Red> <87r1o6bh1u.fsf@nanos.tec.linutronix.de> <20201204132631.GA25321@Red> <874kl1bod0.fsf@nanos.tec.linutronix.de> <20201204192753.GA19782@Red> <87wnxx9tle.fsf@nanos.tec.linutronix.de> <20201205184334.GA8034@Red> <87mtys8268.fsf@nanos.tec.linutronix.de> <20201206214053.GA8458@Red> Date: Mon, 07 Dec 2020 01:15:49 +0100 Message-ID: <87ft4i79oq.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 Sun, Dec 06 2020 at 22:40, Corentin Labbe wrote: > On Sat, Dec 05, 2020 at 08:48:15PM +0100, Thomas Gleixner wrote: >> So this maps two pages and unmaps the first one. That's all called from >> sun4i_ss_opti_poll() and the bug is clearly visible there: >> >> sg_miter_next(&mi); >> sg_miter_next(&mo); >> >> release_ss: >> sg_miter_stop(&mi); >> sg_miter_stop(&mo); >> >> Written by yourself :) Same issue in sun4i_ss_cipher_poll() >> >> Fix below. >> > > Unfortunatly, the crash still happen with the fix. > See http://kernel.montjoie.ovh/131321.log And why are you not looking for the reason of this problem in your own code yourself? It's not a regression caused by my work. Turn on CONFIG_DEBUG_HIGHMEM on 5.10-rcX or older kernels and you will get the very same crashes. My work just made these checks unconditional. This was broken forever and it's not my problem that you did not enable mandatory debug options when developing this thing. I gave you tons of hints by now how to debug this and what to look for. Obviously I overlooked something and here is the final hint: sg_miter_next(&mi); sg_miter_next(&mo); do { .... if (cond1) sg_miter_next(&mi); <--- HINT .... if (cond2) sg_miter_next(&mo); release_ss: sg_miter_stop(&mi); sg_miter_stop(&mo); So yes, I overlooked the obvious, but as I said above it's not something which my is failing due to my changes. It was broken forever, it just was not tested properly. Don't blame the messenger. My knowledge about how to use nested sg_miter correctly is close to zero. I can and did explain you the rules of kmap_atomic/local() but that's it. Thanks, tglx