Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp458578lqh; Thu, 28 Mar 2024 07:08:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUHcK24kCcztvQ7ro2PwMjFTdSrcMaL/1MskPFVhMefRNPl6vZWfP/o8QcbQJX9XSN/eEEgK9zNDcYRi+zLMtqnbDgM/N/fC5XgsfF6Cg== X-Google-Smtp-Source: AGHT+IEKuNB1AkeFoOW8n19p481ZY8E0GZUllzwbbbQA9AXW9Y7pbvY4L3n1JPVc0eee1KMbEtGv X-Received: by 2002:a17:90b:2241:b0:29c:3bed:afb2 with SMTP id hk1-20020a17090b224100b0029c3bedafb2mr2595144pjb.7.1711634924591; Thu, 28 Mar 2024 07:08:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711634924; cv=pass; d=google.com; s=arc-20160816; b=dtTDbgKYs1bOqCK89er1L118zzauKb1KEPcY54Vvz5QuLcjTtMT8YQ67UTjI5kDQdy mWJ43UP7pFVYEIHXekF0QQnEscLJQyW3pix5TkDgNWF6AQbHcPoBrJy2krfmc9b/23yq MBaN+T+XnZIusKsFrs8Pq7T2ADKhbnX/uMR+qxvBdwYzo6zYDKlDhVDRJXx6wWlt94Mp 19TEnYqYXF9eUq1ERcq4sNOYswRscAz8hvAnbrHQB2xm8hcb3IGiINeFt2JlWVRD4L2D g488Quv+5xUX6JX+jGGwE2bb3v5Nay3+IQCTJ73j28Zo0kScuZSgPAJ6P8kwYseL36nI Cw9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UhSlWCplow3q0UiENwQXBqJUPqprxyAeOLjfYZq98Wg=; fh=/n2Zle/iCPY2a0/lsv5VQ2raxC4hhMPEuriT1u/w3vk=; b=pspvg2xpvAbZeRSOc4A1REgkq9fpavLzwN+VJfcMCVX8ym8UlDxQeasD/HuFiKCtE8 aD0go39KPcnNgg+KMf7XxcwVGLgGYHm9bTym5F/UO7hKjngse9UxMpT447jo+Qf9MRgB TXlbgLoXwf2le22Nm3W/mCQokAA7AD8uFVYzvU6u2MY33dVrLZ5RHDctVAFJ79gs6U4n qEhX71XhYR3r7iF3O/mye2MNzxFVPD8do0JjpcsA79oLg53hT3j6bgobtUdKbr+bK3uW o3w8KK4ly2ICtbFLQi93Z9znCWDHfGZ3aJQHqDu/WMvF3nsOAHUHQa8Xva59MlBSQkSn CXKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=u3SzPdnH; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-123009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123009-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ot6-20020a17090b3b4600b002a0091f5256si1714468pjb.186.2024.03.28.07.08.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 07:08:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=u3SzPdnH; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-123009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123009-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 94B832965C1 for ; Thu, 28 Mar 2024 13:59:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA903811FB; Thu, 28 Mar 2024 13:59:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="u3SzPdnH" Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38568847C for ; Thu, 28 Mar 2024 13:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711634346; cv=none; b=rKhCyV17rbunN0uRNkB6Q0WhweoAJ91ZnKOi3fEnoqkSTHL/+5sHZLcNvP0zjcFjGrzypgg9acSInMxUKsLFbUiqwcaJTupqTVbZ1pMTdE6+TAkxzD27HQ4IA0yZM/rPbSSE1m2PG/un0asMGObjIzNMoKxUg0XIvxpHnGnhrsw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711634346; c=relaxed/simple; bh=NK7LET77latJxFetZ4zO1WlQhyaBRI6+mpEFOHPiO1k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=g/1s5FWptl7uWecyrP6a0n21aUvqNeA0vk9jCtYWjZrAJtG+xZRkBFKQq+iQHxhrB2aiv+UPZF0DoDqjK1dmqcRShBeTw57WNDSyejThFhUIJWR5gGyCiJn7HTCBw0m9NRjITXPDFLDcP5nScK3UPbsvF1IcF1yfLwf0pCUAnk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=u3SzPdnH; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-413f8c8192eso75065e9.0 for ; Thu, 28 Mar 2024 06:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711634343; x=1712239143; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UhSlWCplow3q0UiENwQXBqJUPqprxyAeOLjfYZq98Wg=; b=u3SzPdnHOelpWdOjkfNoyINnyjT1lHSr693ZDRQuVdkUCe3RoVv6Lm9ZRjHqvddDyI rHNCCkzKsEpurUYawiOefeDOUieGigBXO8nZ//SBY/DS31ny7roWiDZsO3S2Sb5BRLDJ TPIIKvuduUIi6CnVurDExWnTvMyUuxWJSpoAa0NpCweenpo5Mi3sG2fMkJpRk2z/fh2A Bv61hgGqT1vVmBJS7/urKaainLbdvj9fA45zh7gtteQuo8x1IMtuwjL0vFT0PqUxUQL4 oQziwsUJoUPOe7pXV/ezTMyhKgZbz6XKkGa02C1c66QGtmp8v8sRLpyp+u76orr/1GBj Dnqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711634343; x=1712239143; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UhSlWCplow3q0UiENwQXBqJUPqprxyAeOLjfYZq98Wg=; b=J1fmYhRc+KaTPfbc5vwF5hBtxY7o0mm9yZh8dY712QVCINGtR/8xomFkj9UILqQuSY aL4XJn8rakB/708TEIJt0TF7iQv4X5t5Aum7y2FVLF4syH3/CiJWUhnSrsgji+R+l3w4 cI2i0erYrXfGzm3DZZN1WtobFQ7jFtK4BZXTih7Koe3BUJNKYeJILuJewvJ1GpjNkgw6 G3sRNByD8kdpwQPKhvSuQ9kBbNwWdG7qQneC22+L6RLtCmz7iimX1iAss44UHoilfogo F+KACRVGn4IovpfZELxEX5rsJZOeJQwel3j9YJgVQGKcPhNhDaRibm5Hq2Uh3wX4WaCe /IIA== X-Forwarded-Encrypted: i=1; AJvYcCUUf2K0UX9LDij7V+5lJQitypxhPXLk/AWw593jeN5fl8/QWnx3Op0WGN3oSlZehmrV+toaE2Bot2wkU+snqXnZnP+5xWLBadkgf0XC X-Gm-Message-State: AOJu0YzN94huC3do+kwAyxtwQEGnJDeA5F3L4aTzeo7U24Rdhrb6v0bS ++YFiHU56guYvYl+pLZU/sZdSIgbIJ73xmkBM03eeHJvynSE/fjVh44OW2A6aw== X-Received: by 2002:a05:600c:3584:b0:414:daa3:c192 with SMTP id p4-20020a05600c358400b00414daa3c192mr213991wmq.0.1711634343417; Thu, 28 Mar 2024 06:59:03 -0700 (PDT) Received: from google.com (248.199.140.34.bc.googleusercontent.com. [34.140.199.248]) by smtp.gmail.com with ESMTPSA id l6-20020a05600c4f0600b0041469869d11sm5499477wmq.47.2024.03.28.06.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 06:59:02 -0700 (PDT) Date: Thu, 28 Mar 2024 13:59:00 +0000 From: Sebastian Ene To: Oliver Upton Cc: catalin.marinas@arm.com, james.morse@arm.com, jean-philippe@linaro.org, maz@kernel.org, qperret@google.com, qwandor@google.com, suzuki.poulose@arm.com, tabba@google.com, will@kernel.org, yuzenghui@huawei.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH 2/2] KVM: arm64: Allow only the specified FF-A calls to be forwarded to TZ Message-ID: References: <20240322124303.309423-1-sebastianene@google.com> <20240322124303.309423-2-sebastianene@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Mar 26, 2024 at 01:42:26AM -0700, Oliver Upton wrote: > On Mon, Mar 25, 2024 at 11:29:39AM +0000, Sebastian Ene wrote: > > On Fri, Mar 22, 2024 at 07:07:52PM -0700, Oliver Upton wrote: > > > On Fri, Mar 22, 2024 at 12:43:03PM +0000, Sebastian Ene wrote: > > > > The previous logic used a deny list to filter the FF-A calls. Because of > > > > this, some of the calls escaped the check and they were forwarded by > > > > default to Trustzone. (eg. FFA_MSG_SEND_DIRECT_REQ was denied but the 64 > > > > bit version of the call was not). > > > > Modify the logic to use an allowlist and allow only the calls specified in > > > > the filter function to be proxied to TZ from the hypervisor. > > > > Hi Oliver, > > > > > > > > I had discussed this with Will back when the feature was upstreamed and > > > he said there's a lot of off-label calls that necessitate a denylist > > > implementation. Has anything changed to give us confidence that we can > > > be restrictive, at least on the FF-A range? > > > > > > > I remember your proposal for having an allowlist instead. The current change makes > > sense if we have https://lore.kernel.org/kvmarm/20240322124303.309423-1-sebastianene@google.com/ > > which opens the window for more FF-A calls to be forwarded to TZ. > > Got it. Last time I didn't catch the level of abuse we expect to endure > from vendors, but now it seems we will not support non-conforming calls > that appear in standardized SMC ranges. > > Adding mention of this to the changelog might be a good idea then. > That's a good point. I didn't create a changelog for this but I should add one and specify this. > -- > Thanks, > Oliver Thanks, Sebastian