Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp369988pxf; Wed, 17 Mar 2021 07:09:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxii54BAfq6+yMLm8h7CXgdh1kGEXfMGjWrbvO1HHyqv8qfSXgKsxN8Gi3Rhppe/nkfluj3 X-Received: by 2002:a05:6402:3122:: with SMTP id dd2mr41812594edb.253.1615990173989; Wed, 17 Mar 2021 07:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615990173; cv=none; d=google.com; s=arc-20160816; b=J/nBW2o6BJmVwxC6/CwjCHaPqnRzQH4t/1AwudlhRthCgbRMP4fPBGCyA9wjmEtQhs SDCZcVlSXQDBmR6yoarQo1HkjFmqflul9pkuB7gF68TntSvKXrz/zKLANJK96W0653Y5 14AUhGPRrGLSR5AekpXg+DaIB4/Hg2qPj7EB9mzUtx4hL1xQooHUPhMBb6vZDQUziwP0 G7Cv8dzcj2P4Jd4ZhZJXv7sJMXZIxnmrFxB9Objcot5ZcKjUo0zfim1kHe1fjRCe2u8g ii6eQ6Xa+IbcT+8BaZjjGlCD27MGMltA1d18jq9My8Jvh5D3hBOo4iAhmzJxddskHwfA fRWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=iiibitsH+sfcliUrXRl+bj3LNddNkcu/TdpX8+mN+F4=; b=bGPx9mxcKD2w5tQfC5nXWeQtY0asSRtRu93QtSR6mRBZqXgzC3WpThhtLgMjsAkr9u 2S+5hdiE9UgNFTVabMFTVSQB66kFkkHd+rfZKU7YIYMnQaX05DFt5LtryhmnZAg/wUcT pCGIsbYhW7qBN4coG6ADEtBVmaEI715fvtQrO5dmKldJMumCpaTqolqCQh4x0JJfkuyb v+zB9vWSGynEL0p/w965ehBqkIoj6sdqSrRCS7iUacxUduBYEHmij4XZNR8ge5Jg17Ac 6GM7dtUTcb/Ot5OyEwXHEno8HN9JsHGDybqmT/mO1LaOvAQSPQP6zzln3/DiUhS4EImp NUPw== 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 g11si16595518ejd.733.2021.03.17.07.08.58; Wed, 17 Mar 2021 07:09:33 -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 S231765AbhCQOIQ (ORCPT + 99 others); Wed, 17 Mar 2021 10:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231669AbhCQOIH (ORCPT ); Wed, 17 Mar 2021 10:08:07 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12253C06174A for ; Wed, 17 Mar 2021 07:08:07 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lMWqB-00045n-H7; Wed, 17 Mar 2021 15:08:03 +0100 Subject: Re: [PATCH v1 0/3] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys To: Richard Weinberger Cc: Jarkko Sakkinen , =?UTF-8?Q?Horia_Geant=c4=83?= , Mimi Zohar , Aymen Sghaier , Herbert Xu , "David S. Miller" , James Bottomley , kernel@pengutronix.de, David Howells , James Morris , "Serge E. Hallyn" , Steffen Trumtrar , Udit Agarwal , Jan Luebbe , David Gstir , Franck LENORMAND , Sumit Garg , linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, Linux Crypto Mailing List , LKML , LSM References: From: Ahmad Fatoum Message-ID: Date: Wed, 17 Mar 2021 15:08:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@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 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hello Richard, On 17.03.21 00:10, Richard Weinberger wrote: > On Tue, Mar 16, 2021 at 6:24 PM Ahmad Fatoum wrote: >> This series has been tested with dmcrypt[5] on an i.MX6DL. > > Do have this series also in a git repo to pull from? > I'd like to give it a test on various systems. Yes, please pull git://git.pengutronix.de/afa/linux Branch v5.12/topic/trusted-source-caam It includes these three patches on top of Jarkko's linux-tpmdd/master. >> Looking forward to your feedback. > > Thanks for working on this! David and I will have a closer look these days. Great. Here is a simple testing regiment that could help you getting started: # First boot DEV=/dev/loop0 ALGO=aes-cbc-essiv:sha256 KEYNAME=kmk BLOCKS=20 mount -o remount,rw / fallocate -l $((BLOCKS*512)) ~/loop0.img losetup -P $DEV ~/loop0.img KEY="$(keyctl add trusted $KEYNAME 'new 32' @s)" keyctl pipe $KEY >~/kmk.blob TABLE="0 $BLOCKS crypt $ALGO :32:trusted:$KEYNAME 0 $DEV 0 1 allow_discards" echo $TABLE | dmsetup create mydev echo $TABLE | dmsetup load mydev dd if=/dev/zero of=/dev/mapper/mydev || true echo "It works!" 1<> /dev/mapper/mydev cryptsetup close mydev # Second boot DEV=/dev/loop0 ALGO=aes-cbc-essiv:sha256 KEYNAME=kmk BLOCKS=20 losetup -P $DEV ~/loop0.img keyctl add trusted $KEYNAME "load $(cat ~/kmk.blob)" @s TABLE="0 $BLOCKS crypt $ALGO :32:trusted:$KEYNAME 0 $DEV 0 1 allow_discards" echo $TABLE | dmsetup create mydev echo $TABLE | dmsetup load mydev # Should print that It works! hexdump -C /dev/mapper/mydev -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |