From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16E47E77188 for ; Thu, 26 Dec 2024 11:26:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F8E610E033; Thu, 26 Dec 2024 11:26:33 +0000 (UTC) Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA4AD10E033 for ; Thu, 26 Dec 2024 11:26:31 +0000 (UTC) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 73F66100D9404; Thu, 26 Dec 2024 12:26:29 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 476F630F89E; Thu, 26 Dec 2024 12:26:29 +0100 (CET) Date: Thu, 26 Dec 2024 12:26:29 +0100 From: Lukas Wunner To: Sumit Garg Cc: simona.vetter@ffwll.ch, Jens Wiklander , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, op-tee@lists.trustedfirmware.org, linux-arm-kernel@lists.infradead.org, Olivier Masse , Thierry Reding , Yong Wu , Sumit Semwal , Benjamin Gaignard , Brian Starkey , John Stultz , "T . J . Mercier" , Christian =?iso-8859-1?Q?K=F6nig?= , Matthias Brugger , AngeloGioacchino Del Regno , azarrabi@qti.qualcomm.com Subject: Re: [PATCH v4 0/6] TEE subsystem for restricted dma-buf allocations Message-ID: References: <20241217100809.3962439-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Dec 26, 2024 at 11:29:23AM +0530, Sumit Garg wrote: > On Tue, 24 Dec 2024 at 14:58, Lukas Wunner wrote: > > However in the case of restricted memory, the situation is exactly > > the opposite: The kernel may *not* be able to access the data, > > but the crypto accelerator can access it just fine. > > > > I did raise a concern about this to the maintainer, but to no avail: > > https://lore.kernel.org/r/Z1Kym1-9ka8kGHrM@wunner.de/ > > Herbert's point is valid that there isn't any point for mapping > restricted memory in the kernel virtual address space as any kernel > access to that space can lead to platform specific hardware error > scenarios. And for that reason we simply disallow dma_buf_mmap() and > don't support dma_buf_vmap() for DMA-bufs holding TEE restricted > memory. The API for signature generation/verification (e.g. crypto_sig_sign(), crypto_sig_verify()) no longer accepts scatterlists, only buffers in virtual address space: https://lore.kernel.org/all/ZIrnPcPj9Zbq51jK@gondor.apana.org.au/ Hence in order to use buffers in restricted memory for signature generation/verification, you'd need to map them into virtual address space first. Thanks, Lukas