Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6960945ybi; Thu, 1 Aug 2019 01:02:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMFtSJH6JCZzS4ymW2qvn6+bMyz86QnztBnD+Y3H6CGtu8bsLQXKY6p/5pMxBxnCg8h7KV X-Received: by 2002:aa7:915a:: with SMTP id 26mr51730896pfi.247.1564646571837; Thu, 01 Aug 2019 01:02:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564646571; cv=none; d=google.com; s=arc-20160816; b=zQsVMU0nh59mfyIU7JV1QumbrUM+IuyhkYTF+Wk84Uqs0Eqas6g5eyj9RILzfNDC4K Br1PXTtdx37J42a16A3Ls4wp/GXLdjX8zroFE440jH852jn1c0o3qG3iEdptJ5e0mAZ0 6CWsTB2XbVfMBD3ovU/wz2Nu962Q/PdOkLadoU1iWd+0bbutVkXDUHyJ1VAR8VotDp5M MepElaGIOMOPha09vdjk3xL/HtwBESjB98bScP1/mI2uAOPaK7IQJbJobe60ANehlnd3 oyJFoy3xJ7hYpEQsCeqVKv2b3aidQa0N1xqozwNsmPrb6Ea79oeWvd8BjeW/L8RrCZVW /VgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VAiKQtrdWdpAymEw2Fi6xVY10VrsZzJSh6lsPenXn5c=; b=YPXXc0UtNJmf+PyoFA7mjMKfM3GRB1IRIn88+ES/voXluTmrSWK2w2ztbPDLGVQlKF fdethPXKidr9Cu7srINYG6wq3RLcHPOsfVSqRt4rI4VAYyZeU9ElhCUvjFlanu2GJZOR vS6ESSq5U6tgr8Xw+FHSWb9LR/CgjNZZwZzViJCGPRQNFtWGWymc0jn59d4FrobBWTLU G2X8VSkAnRqlIMZl+FmjOYBbVJola93CNkzxO2AMEbZbN1vT0yA7hbzjFje3sToLmN5d ALOHizH0M/jY4drC6v7HjNWNVfHaYqwFRx2/J97lEfoyv4owcX0sWMdGclJ7h8NRkgT7 JKPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KyWodxvz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k143si33726777pfd.212.2019.08.01.01.02.34; Thu, 01 Aug 2019 01:02:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KyWodxvz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730751AbfHAIAF (ORCPT + 99 others); Thu, 1 Aug 2019 04:00:05 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:37351 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730514AbfHAIAF (ORCPT ); Thu, 1 Aug 2019 04:00:05 -0400 Received: by mail-lj1-f195.google.com with SMTP id z28so14180137ljn.4; Thu, 01 Aug 2019 01:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VAiKQtrdWdpAymEw2Fi6xVY10VrsZzJSh6lsPenXn5c=; b=KyWodxvzOSUl5vMHnbnrwzIAAyi2FLqjzsrJG4CDOo0xubx8uDbAyXqHvMjXb2EZKR 3OTkmSgzUW5s4OFzZOJtJzkxL2Vw9tpTOsPuHNmJL10tEdjzf6+u9Z5Dm7Ybjzo2Fsnq upL41HGVkP0Apu7kDsQGa73HXRgsYJ4eGQN4LQaCrmmTCyKiMdEQRG2WVK4rAboEaFkL GR3a+bW/b/pBTN2NDcQHelOqJxfXR1ACeiixyEc+ACqJNOoNIwLeHNt7Gkj296UvulJw dWF9aAtR4dZnfFwdJPh3B21ex1Yyr1oWQ/ZqlU8QV6eNaXvHxEZcelG2uu1GWLoxBxgQ 663w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VAiKQtrdWdpAymEw2Fi6xVY10VrsZzJSh6lsPenXn5c=; b=GvMWCV/U9YOcLE4xcfMJjDR2SgtqeDGi7BJRHME7AqL7mr1ixuAmutOym0m4hpP9gI 9KJJiLh0a33oWkNvIlGJye3VJr7FaBpYMltsPF9ZuwiNyVThVc7NF9sCkmpaeL+VW8S6 JzHBjf3FlyEYnvmCpoytOs3XjGzzCn0mZtlv4yiOnhnRm9vts48kC8gObXYDu9acLLD6 pbfAi5YymPeSa+la3G9jxEYjwOe/rxKK2TfAp80/A1tUUKudy7iAtQiRqmlNFesL/EmR ZOAG9VHLTE4JURgLRx0s0RPI0IYEwJ7AaY7xTuQbEpn6wiGR9N33TA0caDofY0MQk0Gu psaA== X-Gm-Message-State: APjAAAV4H70kcD1p9bp7ucO1MXqQOHlQUUBk8sp+jH9za1IPL0ZpS3Zt FL3iuRp9YJZkNG9rqQicEvdIFpDW58lVPftCJTA= X-Received: by 2002:a2e:5d92:: with SMTP id v18mr67333062lje.9.1564646402586; Thu, 01 Aug 2019 01:00:02 -0700 (PDT) MIME-Version: 1.0 References: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> In-Reply-To: From: Janne Karhunen Date: Thu, 1 Aug 2019 10:59:51 +0300 Message-ID: Subject: Re: [RFC v2 0/6] Introduce TEE based Trusted Keys support To: Sumit Garg Cc: keyrings@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, Jens Wiklander , Jonathan Corbet , dhowells@redhat.com, jejb@linux.ibm.com, Jarkko Sakkinen , Mimi Zohar , James Morris , "Serge E. Hallyn" , Casey Schaufler , Ard Biesheuvel , Daniel Thompson , Linux Doc Mailing List , Linux Kernel Mailing List , linux-arm-kernel , "tee-dev @ lists . linaro . org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 1, 2019 at 10:40 AM Sumit Garg wrote: > > I chose the userspace plugin due to this, you can use userspace aids > > to provide any type of service. Use the crypto library you desire to > > do the magic you want. > > Here TEE isn't similar to a user-space crypto library. In our case TEE > is based on ARM TrustZone which only allows TEE communications to be > initiated from privileged mode. So why would you like to route > communications via user-mode (which is less secure) when we have > standardised TEE interface available in kernel? The physical access guards for reading/writing the involved critical memory are identical as far as I know? Layered security is generally a good thing, and the userspace pass actually adds a layer, so not sure which is really safer? In my case the rerouting was to done generalize it. Any type of trust source, anywhere. > > > Isn't actual purpose to have trusted keys is to protect user-space > > > from access to kernel keys in plain format? Doesn't user mode helper > > > defeat that purpose in one way or another? > > > > Not really. CPU is in the user mode while running the code, but the > > code or the secure keydata being is not available to the 'normal' > > userspace. It's like microkernel service/driver this way. The usermode > > driver is part of the kernel image and it runs on top of a invisible > > rootfs. > > Can you elaborate here with an example regarding how this user-mode > helper will securely communicate with a hardware based trust source > with other user-space processes denied access to that trust source? The other user mode processes will never see the device node to open. There is none in existence for them; it only exists in the ramfs based root for the user mode helper. -- Janne