From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5C9A418341; Thu, 20 Aug 2026 10:50:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787223051; cv=none; b=pNaOaq1b62Tl0Dna6F8DPppxxO8HQsmXVnLCKjpzjlZMLiXvGnydBi8s4j9VXXAhvtFNgKDRC23FAsvDejJ+Efdevr5/NTPrwrif7JEAne1P3S8WRdqMVuwUXgzQhg4Z5HIZN6ic4w02NLjtFviSPbWF7sm4wFDYidtG2fN3Q1I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787223051; c=relaxed/simple; bh=s+cclRtih9v6Hs6kBVo28nQebq5TpBMtlvcObiYbvrQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JJD7/3nUs/eZmj7Y955vk3+zETuwhXeLzhDVQSSSIgkB9H3O/jH+UoQ5wIY7kE77D2J5saOucOVq1HVT2s907OY2TVPLNGVeIgT+hMq7nOPaehzZaN7sdQ07eCvBbdCJloLeRpIP0ApHGJbIpgx4/M5SmsCyKtWv1EQjq1Tuu7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=mlwwcH/a; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="mlwwcH/a" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 62090153B; Thu, 20 Aug 2026 03:50:45 -0700 (PDT) Received: from e122027.cambridge.arm.com (e122027.cambridge.arm.com [10.1.25.29]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1A10D3F66F; Thu, 20 Aug 2026 03:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1787223049; bh=s+cclRtih9v6Hs6kBVo28nQebq5TpBMtlvcObiYbvrQ=; h=From:To:Cc:Subject:Date:From; b=mlwwcH/aloHp948hET2x3PglkjTmwV/C1vkj4LhUjCsvHCVxnIRjXXyQwKoBYSh4b W+TlkspsuCda4N8/HpdlCseT+Wzo469vRfIBo0hw8qEsFKeS3KGD/R2gvOJo0XQPrb myWmYHFHFnn8mQ0++38cbrZszC/fDjicPCDrukH8= From: Steven Price To: =?UTF-8?q?Christian=20K=C3=B6nig?= , Marc Zyngier , Sumit Semwal , Thomas Gleixner Cc: Steven Price , "T.J. Mercier" , Benjamin Gaignard , Brian Starkey , John Stultz , dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Jason Gunthorpe , Jiri Pirko , Marek Szyprowski , Suzuki K Poulose Subject: [PATCH 0/2] Clear shared pages after private-to-shared conversion Date: Thu, 20 Aug 2026 11:50:23 +0100 Message-ID: <20260820105026.53208-1-steven.price@arm.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Arm CCA includes "Memory Encryption Contexts" (MEC) which allows the private and shared data accessible to a guest to have different memory encryption keys. Consequently when converting memory to shared, the memory encryption key used to access the physical page will change. Both the GICv3 ITS driver and the system_cc_shared dma-buf heap currently allocate memory with __GFP_ZERO and then decrypt it. With MEC the zeroing is done with the wrong encryption key and the data visible after decryption may be ciphertext. The RMM is required to scrub the data, but may perform this scrub with a different encryption key to the eventual key that will be used for shared access. Fix these two sites by avoiding the __GFP_ZERO during the allocation and performing a clear_pages() call after the decryption. Steven Price (2): irqchip/gic-v3-its: Zero shared pages after conversion dma-buf: heaps: Zero system shared heap pages after conversion drivers/dma-buf/heaps/system_heap.c | 14 +++++++++++--- drivers/irqchip/irq-gic-v3-its.c | 7 ++++++- 2 files changed, 17 insertions(+), 4 deletions(-) -- 2.43.0