Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp694129pxf; Thu, 11 Mar 2021 12:31:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJylIfHTy/OkGQnriJ/SlqE5UiRFnY5IwlfP4gvCXBqnci7HDZy1PCJdMWQrw5XTL85ETI8v X-Received: by 2002:a17:906:af97:: with SMTP id mj23mr4962937ejb.419.1615494664121; Thu, 11 Mar 2021 12:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615494664; cv=none; d=google.com; s=arc-20160816; b=d8VeCoVrj8ki7c0ul3X2z7HKhqGRj3tDw1Gv9UfuizchqWAKODpvzFA/aUcD1SOkG/ INjHCL9X0oPkUJDnrXyfzwxKK0SmUFTcc/GwyzQsp0zaqS+BImCdPV/yRY6OdE6qLkhW r+3kdIffh1Dmo4a5JlUBMTxrEUhSq4bLj+NIss7E/ocye1GbPbN9S9CuUN+ZXbVt2uuO kKW+vip0K6SL4ndI/uytsL3JbdSw7+Lq0vzcldf8owZ2KTElGHd/kyNj68zMZa/Fstqi ft76RDhV4DrkR/o34pTPSQUvkYMF+oWMBobI12p/0REyjqFyMvZqIsaZE4SbGCa9KkjC AKGg== 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:subject:from :references:cc:to; bh=9+jRAVfAa083/ct08fTSui3aQr+elQBsvXaK/tRrNCE=; b=kq602QnrmtL30kq5tR0gwFMIOE3koRY5Dx57/SZRcvO50yN46U8mBTpqdEyLD5jzEt YJ+nQ/2kXE88AUbukAlbLe4zwjumJqZ7YbhiqxXprnyodlbEfJuBsMU2Uji3fbeqlCv/ X3kGhVdtgiKOGf9kwKjYWTe7MUugAv9qu3bGPNpxVW7KkdN8w5hXlcV8JHdGvjAiDFYX FOXM9y6+52uY/dHNX98GnObcktxWu3uTMTrvU4q+CUQo80fV0nrtXp9S799fjorZreR+ FWuGDIGBJVrS19oEZv0pmdpg2iLdEtfcp7Uc4eLtxMEnXRVi+tLgNCxOkZQ3ZSsW66EM mfoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si2472400ejk.722.2021.03.11.12.30.40; Thu, 11 Mar 2021 12:31:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbhCKU3l (ORCPT + 99 others); Thu, 11 Mar 2021 15:29:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbhCKU3e (ORCPT ); Thu, 11 Mar 2021 15:29:34 -0500 Received: from mail.marcansoft.com (marcansoft.com [IPv6:2a01:298:fe:f::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E474C061574; Thu, 11 Mar 2021 12:29:33 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id B5444425BB; Thu, 11 Mar 2021 20:29:25 +0000 (UTC) To: Linus Walleij Cc: Sumit Garg , Arnd Bergmann , "open list:ASYMMETRIC KEYS" , David Howells , Jarkko Sakkinen , Joakim Bech , =?UTF-8?Q?Alex_Benn=c3=a9e?= , "linux-kernel@vger.kernel.org" , Maxim Uvarov , Ilias Apalodimas , Ruchika Gupta , "Winkler, Tomas" , yang.huang@intel.com, bing.zhu@intel.com, Matti.Moell@opensynergy.com, hmo@opensynergy.com, linux-mmc , linux-scsi , linux-nvme@vger.kernel.org, Ulf Hansson , Arnd Bergmann References: <20210303135500.24673-1-alex.bennee@linaro.org> <20210303135500.24673-2-alex.bennee@linaro.org> <20210305075131.GA15940@goby> <6c542548-cc16-af68-c755-df52bd13b209@marcan.st> From: Hector Martin Subject: Re: [RFC PATCH 1/5] rpmb: add Replay Protected Memory Block (RPMB) subsystem Message-ID: <02d035ca-697d-1634-a434-a43b9c01f4a9@marcan.st> Date: Fri, 12 Mar 2021 05:29:23 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: es-ES Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/03/2021 23.31, Linus Walleij wrote: > I understand your argument, is your position such that the nature > of the hardware is such that community should leave this hardware > alone and not try to make use of RPMB for say ordinary (self-installed) > Linux distributions? It's not really that the community should leave this hardware alone, so much that I think there is a very small subset of users who will be able to benefit from it, and that subset will be happy with a usable kernel/userspace interface and some userspace tooling for this purpose, including provisioning and such. Consider the prerequisites for using RPMB usefully here: * You need (user-controlled) secureboot * You need secret key storage - so either some kind of CPU-fused key, or one protected by a TPM paired with the secureboot (key sealed to PCR values and such) * But if you have a TPM, that can handle secure counters for you already AIUI, so you don't need RPMB * So this means you must be running a non-TPM secureboot system And so we're back to embedded platforms like Android phones and other SoC stuff... user-controlled secureboot is already somewhat rare here, and even rarer are the cases where the user controls the whole chain including the TEE if any (otherwise it'll be using RPMB already); this pretty much excludes all production Android phones except for a few designed as completely open systems; we're left with those and a subset of dev boards (e.g. the Jetson TX1 I did fuse experiments on). In the end, those systems will probably end up with fairly bespoke set-ups for any given device or SoC family, for using RPMB. But then again, if you have a full secureboot system where you control the TEE level, wouldn't you want to put the RPMB shenanigans there and get some semblance of secure TPM/keystore/attempt throttling functionality that is robust against Linux exploits and has a smaller attack surface? Systems without EL3 are rare (Apple M1 :-)) so it makes more sense to do this on those that do have it. If you're paranoid enough to be getting into building your own secure system with anti-rollback for retry counters, you should be heading in that directly anyway. And now Linux's RPMB code is useless because you're running the stack in the secure monitor instead :-) -- Hector Martin (marcan@marcan.st) Public Key: https://mrcn.st/pub