Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6982808ybi; Thu, 1 Aug 2019 01:23:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFLRmDqgZysfIJpcmWhvIDm8m/35eiEeTBlc9rjECiJj4voDnxmtI3VcozrHXKtF7rjLHA X-Received: by 2002:a63:d34c:: with SMTP id u12mr103472356pgi.114.1564647820559; Thu, 01 Aug 2019 01:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564647820; cv=none; d=google.com; s=arc-20160816; b=mE4Pmj9s0TAY1+SI9KHgATXyDkFwU6FlWDRXjuGpj1aSiaAEXuPqCWoPKcFcxWcLQx uRhp3rYz0ad6u/MwmjPPCgoXV7Z9JZ0u7k3E3EXjhGXTSaA5SvN9OOzfzXWMjXAf698D q7j9286j6D7RdGi0pgkQy3Kn/rHpxZWgIsHzAPJleOeQb3TpZ9QXJ6d6XutHlRFdphUY t3+SSPDrFBLqwww+9NbIaAv/NAeqhbHY2FfC/INy+MkT7GywENQEBAAaRGVcdG6KfEt4 Ilsdw6ChSN8pqAIJC8VSmE2W/D+zpkt3vs2dC4D7qSaGxWbdYofFLAc5zgp/HUGqAySr eTKw== 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=H2DnLeysC51Jmq+BwRcdvsefRXSYiI2YJl6s9A/zlto=; b=pAMOSASkmSuWFcU7ohZivHKX9Jij9v93Qs8V4Rv7QTBugBqp3G7kbkpEynqs5w7bRU yzo9aGY82bzn+lE2K2z4lA9OdLy4z6QtcBxkdx7Q5jmGrgwQ+tPSeYn9l3zfuNRycJko 5x2FKZ/HWFWl5vmgQs5hS3udwrO3tJ/AHMIlBKyy77yLBpZtjWSKSJ16uS7y6/LjfzJR wVbH4Nr+pjeiKN8vr2M1os+X0GLWiqexs43PLc4sCxybsRZo3UD8mk9lr1ybQMr2XZSG 8NoYjBYJqEoi7iGzoa58xBGC+NPUcDPmmTmsNaWae8LSMUpB01qd4pTX9lf93mqSWucJ i2KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qrMT7Pcg; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si37659355pgs.576.2019.08.01.01.23.25; Thu, 01 Aug 2019 01:23:40 -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=@linaro.org header.s=google header.b=qrMT7Pcg; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730618AbfHAHkw (ORCPT + 99 others); Thu, 1 Aug 2019 03:40:52 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:36838 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730486AbfHAHkw (ORCPT ); Thu, 1 Aug 2019 03:40:52 -0400 Received: by mail-lj1-f196.google.com with SMTP id i21so68363448ljj.3 for ; Thu, 01 Aug 2019 00:40:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H2DnLeysC51Jmq+BwRcdvsefRXSYiI2YJl6s9A/zlto=; b=qrMT7PcgSqQaPkhDNxMbADKheyhBnSC+xpb7kKF54VBYkSMPossLqpaZCuNtF0lDMK qXMEZEB3PZU5mAOOK9m7rgG41ScrZQmYocuw/IlarqJeVGqi35sAmjysYfxFyzDpdwrE q0o1/fC76kq7sPI1X42ApVVwfrkAaLdqAWBgpE4pkfS5OjtTTBWyOF0eCL4MZjZx1E5O hL8RRxrqjhZmDoasT8A3YGGN8527eUUnk+H3CroOjZQa0hqO8N1YZkTAY116z0aFZIV/ b8i6FslmwUzzoFlRmDqExDGN92AQOqj3haKzc3fHcFHkDuqot0ElZe4/3d+LWlRDtHx3 44jQ== 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=H2DnLeysC51Jmq+BwRcdvsefRXSYiI2YJl6s9A/zlto=; b=kwRkST95e1HgicnlSh/CN/aA7K/TIQB8w1M1EkEDZUBVlZvWlmhDUoIhvoPUt4FIif hhxsxRcaI/z48j65/xvagSiTREYdWgzVJEDX6mkW8H4+FEO0mnc5EVeqgmpJhThBtPIb JhdrFonPcaPDrLAR9tAWspN8l6Bli8w7mqQ2g1t7wDj4aYJ06Et/Lre4bH2rGzJJmkXh AeKj13QBjCoT7XBGo5NLky0XQI84nZE9N76L2W7Hbgjr8IqfEvx0vTAhgwIGp6ZGV99j 19+/FNuyUblIrZV6fLhChZe4Gj7LMNTyp/uPTDSCGmEVDkY16jBDfGo4lXREhcSCXJJB hhkw== X-Gm-Message-State: APjAAAXK9l+U2uwiZvOh5TLR71jPTJQQSysLz4wiAL04DOLMULEw0wPk juqGDuIL+RLUOkVKA9KpWexG2oi8j9RjwHst7BpTWg== X-Received: by 2002:a2e:970a:: with SMTP id r10mr63101245lji.115.1564645250122; Thu, 01 Aug 2019 00:40:50 -0700 (PDT) MIME-Version: 1.0 References: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> In-Reply-To: From: Sumit Garg Date: Thu, 1 Aug 2019 13:10:38 +0530 Message-ID: Subject: Re: [RFC v2 0/6] Introduce TEE based Trusted Keys support To: Janne Karhunen 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, 1 Aug 2019 at 11:51, Janne Karhunen wrote: > > On Wed, Jul 31, 2019 at 4:58 PM Sumit Garg wrote: > > > > To clarify a bit further - my thought was to support any type of trust > > > source. > > > > That could be very well accomplished via Trusted Keys abstraction > > framework [1]. A trust source just need to implement following APIs: > > > > struct trusted_key_ops ts_trusted_key_ops = { > > .migratable = 0, /* non-migratable */ > > .init = init_ts_trusted, > > .seal = ts_key_seal, > > .unseal = ts_key_unseal, > > .get_random = ts_get_random, > > .cleanup = cleanup_ts_trusted, > > }; > > Which is basically the same as implementing a new keytype in the > kernel; abstraction is not raised in any considerable manner this way? > It doesn't create a new keytype. There is only single keytype: "trusted" which could be implemented via one of the trust source available in the system like TPM, TEE etc. > 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? > > > > > With the > > > user mode helper in between anyone can easily add their own thing in > > > there. > > > > 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? -Sumit > > -- > Janne