Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2137036ybl; Thu, 9 Jan 2020 07:30:04 -0800 (PST) X-Google-Smtp-Source: APXvYqxJLOJV9capg49D4A7+XdUYYNV960RevIxaSd3i5JEZqpM9K2XVdSxbb2QZYTayMqjwB9G4 X-Received: by 2002:a9d:242:: with SMTP id 60mr8779533otb.253.1578583803922; Thu, 09 Jan 2020 07:30:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578583803; cv=none; d=google.com; s=arc-20160816; b=hPwhnoXv9fI1Nqu3+dhZ9qTMWvSDLcEQBHmAnsMOmzVkIqGhuiKTGF9nzyanmpO7hG UYp+rR2F4H0T7/MncVFV7fTgJZOuVIJCByxE3gmoQb2RlvggWR1xwBuSbKvZBU4T2h4r wAobXkY5E9g81pTo0jj7G1kpQJnhEfMCibOoB4tyIaLM7UaOoH2dsOg9vemZpaWBxFVD jwnI1KwAqYPhXeqzjuV9+Dm6REfQv3UVTSgcC+yhPGNevBX+CgTuli0tLzaCmfaWrsPn cGcfqPpF84CUXzcMvsz8jO/TWKZadKB4NmlWf9/w6sMZ4pR+9DcrUFe4lE4t2fZp4nhV m2Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=8ATHHjw+2Gy5yajVd+lnqDYNhxrLs6riTR9Mwxkks8o=; b=GP+sMb+v9NTJumwhCww26cHPeY+ERlLEYqYgIoq5nMIpnVpZBdMNaiF+zmlDkjqPTh peBWWd/45ThsqwMDITGpnxszRJLynsHxbenuKluNoHu0ABnE82dtnrBW69FJUbB4Knk1 LnFVgpwtg6qaZUk+vKICGuIlYwVlhFgHAjCHUMRlv2fOotU92jqRL8iRQ+7/w+TWmf1C eu1WPcLfpNZ/wP6eEQAME6CicbIKCpMQMonrFLtAuvKZ+lDJz2fZnQp4zGIvkwih+HMT hKsvhqa8Z1hZE57FdoFsmDa1kq0UHUZ/O0cNej9Yvhvq/SAAjdzK3WP0gdoOKSmz/Ioq OZXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XtU4jQny; 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 s6si4262952otp.126.2020.01.09.07.29.51; Thu, 09 Jan 2020 07:30:03 -0800 (PST) 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=XtU4jQny; 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 S1729779AbgAIMhb (ORCPT + 99 others); Thu, 9 Jan 2020 07:37:31 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:38832 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729693AbgAIMh2 (ORCPT ); Thu, 9 Jan 2020 07:37:28 -0500 Received: by mail-lj1-f193.google.com with SMTP id w1so7069729ljh.5 for ; Thu, 09 Jan 2020 04:37:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8ATHHjw+2Gy5yajVd+lnqDYNhxrLs6riTR9Mwxkks8o=; b=XtU4jQnydjSlY5UiCiIDnULQB3GGRWkrFSqkjSTah25E1N6OmyawSK0/eVhu3jr8+0 P+vx5XGy92SaJyqNbn+M9/gPmL1lhk5CJbSaoKVI4LffA4BZfkMtBJCdFMXkF1+wiD/Z YDNhXI04n3cAzziqQ8mQr9icPRjEeF2LE6I6t8EJXN4fb/mtwa79D1JGKqmA6sJzuFMY pcoHLWIjkNvJBCQkK8JqoIXAcaI1CTybClbKkPq3FeWVYbFpEwh9T5ZEBM8dd4c+0n0f kGzweqD9K9LfpH02QBhTyfj4/YR7fNTV0cyfT1h7J1DU6WYIPN4QvmXFvKkBZj8bV0L2 Ps1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8ATHHjw+2Gy5yajVd+lnqDYNhxrLs6riTR9Mwxkks8o=; b=QxO0+UDrMquGiqP2dBPKEF0pQ6pIsh1mKaZU/fvYQl7J7zixo5mGkp/IqUc8gjqYxC dQe05UZpPYzmphB/BHCIDwKkhvUlOA6NtlU1Rc0Y0cOilw0y4Hg2J6sJYW3hko/JmUUj nHFWErD1GDkDr8/vmuM+5BecWAbDd2pl60ntV7J2nOUXU3bTJL3b2vQFjSumLsoMFmfA o8jlnNeUnFac305zDDnDis+SN6gJiNFtdbrlRszSMkShjFp3FYj16jsAEaeR1B63IhRW /fN1+CwLehtp2oCgKC6XdDuNNLzJIyJH4GgtQjIp2ThmQDlcIHlUOaYCZeCC4BhsqYjQ MIxg== X-Gm-Message-State: APjAAAVVd+a4Cd4ndVzW/Hp++p1NVCOHfiyK5W6e9MIIXB7VlFK8r6Bq JsyKTqFFQFA2CBEMxmVenNDcQQ== X-Received: by 2002:a05:651c:1110:: with SMTP id d16mr6601261ljo.86.1578573446657; Thu, 09 Jan 2020 04:37:26 -0800 (PST) Received: from jax.urgonet (h-249-223.A175.priv.bahnhof.se. [98.128.249.223]) by smtp.gmail.com with ESMTPSA id u16sm2887724ljo.22.2020.01.09.04.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2020 04:37:25 -0800 (PST) From: Jens Wiklander To: tee-dev@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Jerome Forissier , Sumit Garg , Etienne Carriere , Rijo Thomas , Devaraj Rangasamy , Jens Wiklander Subject: [PATCH 5/5] tee: tee_shm_op_mmap(): use TEE_SHM_USER_MAPPED Date: Thu, 9 Jan 2020 13:36:51 +0100 Message-Id: <20200109123651.18520-6-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200109123651.18520-1-jens.wiklander@linaro.org> References: <20200109123651.18520-1-jens.wiklander@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org tee_shm_op_mmap() uses the TEE_SHM_USER_MAPPED flag instead of the TEE_SHM_REGISTER flag to tell if a shared memory object is originating from registered user space memory. Signed-off-by: Jens Wiklander --- drivers/tee/tee_shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c index c64ec5c5e464..deb22f877881 100644 --- a/drivers/tee/tee_shm.c +++ b/drivers/tee/tee_shm.c @@ -81,7 +81,7 @@ static int tee_shm_op_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) size_t size = vma->vm_end - vma->vm_start; /* Refuse sharing shared memory provided by application */ - if (shm->flags & TEE_SHM_REGISTER) + if (shm->flags & TEE_SHM_USER_MAPPED) return -EINVAL; return remap_pfn_range(vma, vma->vm_start, shm->paddr >> PAGE_SHIFT, -- 2.17.1