Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp689141yba; Thu, 16 May 2019 07:26:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzJWIDWkbzMPHKB/y/V+RsOH6mBtV9STkwar8VPHQjEcCK21ROTlWTtKz8l+F8wXIDeUkq X-Received: by 2002:aa7:8243:: with SMTP id e3mr54316653pfn.213.1558016808915; Thu, 16 May 2019 07:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558016808; cv=none; d=google.com; s=arc-20160816; b=cKg+2wEdQvwI0xPnySYsg79pPGvT0ilpbMi/3F3zOTYYSCp0i55qY+DlV0W8W4qbYt 28dlODiEyANU4XUJ0jgZIVBJNHseND5jjuwjfVg/1yMmZOjVjgI9R0puKqP5E2j/G+Dh nRfaqac2ndtuxim0Wx0gJmBTDMUP6woWvSqdn6+jdVH/q5Ctm5owQVy4CxgniG5XgW+u /6VODZAkf+Ypc7mINhbio297mzZZ5iY+DXBj22EWqydBQvxiq0b0yytaUqeM+jJmGfjs 8IQar3So353sI6+S+gIY6kylDVfHduN2SuKeArImIoR8BuKEjJDJPM2rGbDknr9ndkgD lnbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fIrZ76VEAuL7aYCOMXOPXiEonaGPTaFakR0TYFE6xGw=; b=k5+pRyZhzvUFI7uG3mBgOdKRO/muRNil7yqL5QxISjF6cMpllQ3NUTzHNOQPyJTWVp uZQeaW5x60cr+iv3cWKn/3cjhWzhwSqtk4AR9gsYei8dkoFTCQ/XqYOx3MErAqRTuT3q bt3+g/EX439UWtHmKhSmjIOWvl+jxwAp87fa7M84zjmUYkEoQZfNohn4ge/jMZZ6qJ7r QH5QcnyCn2PGyVVjY6zZQ/STnLxmNZtvvvV2apc8kM/NRzCVsUtxQmdKdFPjpRpCBeAD /ZgyP6opyZMTppK096n/BimU58sEPWKPHWmVhtvTCQRVSQE3G3UFKVvNM09oAu8mKtW/ l2qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si5080099pla.409.2019.05.16.07.26.34; Thu, 16 May 2019 07:26:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727163AbfEPOZC (ORCPT + 99 others); Thu, 16 May 2019 10:25:02 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:40529 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727121AbfEPOZC (ORCPT ); Thu, 16 May 2019 10:25:02 -0400 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hRHJd-0003iC-BS; Thu, 16 May 2019 16:25:01 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1hRHJd-00082y-2g; Thu, 16 May 2019 16:25:01 +0200 Date: Thu, 16 May 2019 16:25:01 +0200 From: Sascha Hauer To: Horia Geanta Cc: "linux-crypto@vger.kernel.org" , "kernel@pengutronix.de" Subject: Re: [PATCH] crypto: caam: print debugging hex dumps after unmapping Message-ID: <20190516142501.tysjwqmiznwfowet@pengutronix.de> References: <20190515131324.22793-1-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 16:24:46 up 59 days, 1:35, 89 users, load average: 1.00, 1.05, 1.08 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, May 15, 2019 at 04:27:51PM +0000, Horia Geanta wrote: > On 5/15/2019 4:13 PM, Sascha Hauer wrote: > > The debugging hex dumps in skcipher_encrypt_done() and > > skcipher_decrypt_done() are printed while the request is still DMA > > mapped. This results in bogus hex dumps with things like mixtures > > between plain text and cipher text. Unmap first before printing. > > > The description is not accurate. > req->iv is no longer DMA mapped since commit 115957bb3e59 ("crypto: caam - fix > IV DMA mapping and updating"), so this is not related to IV DMA unmapping vs. > print order. > > Currently: > -for encryption, printed req->iv contains the input IV; copy of output IV into > req->iv is done further below > -for decryption, printed req->iv should be correct, since output IV is copied > into req->iv in skcipher_decrypt(), before accelerator runs > > Could you please resubmit with updated message? Just did that. Thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |