From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.2847.1687801611803449742 for ; Mon, 26 Jun 2023 10:46:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OQQS22+n; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: quicinc.com, ip: 205.220.168.131, mailfrom: quic_llindhol@quicinc.com) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35QEKq95005560; Mon, 26 Jun 2023 17:46:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=chI5AV26ywPZeYY098+0vYzhQ46y7g8jYN/RQi/jW+A=; b=OQQS22+nu9GlHSewqexxxf1ikeJp1nxYkGA637jbVjsS8lJPC6okvtL7UIpxFJO29uNu KJBgyWkL8/itMqydJl7d0VMPP8sev7UxVO2AYSaCuYdgDeamSFqdeXgFxiQEOutZ3SYT B8y32THnRFx2wCYrLHtyo4psJA0btYahRXpmOmpmpPaXE+6kj5nzpu+lN7QSZU4CZhfR VcJg1m1bsGE0MfAlaxOhni3/ag0TUJVfhW7b2ewi8cT7ppQyUr7rub9d3NFOL5YEWLAB Ak0vLb5PMhUHGREKFSrWhikKeJkvZ5IiW+3LT5F1yQl7Kz9AI+V2yYdrZrLf8QClzOSX 5Q== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rfart8q6k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Jun 2023 17:46:47 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 35QHklLi031264 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Jun 2023 17:46:47 GMT Received: from qc-i7.hemma.eciton.net (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Mon, 26 Jun 2023 10:46:44 -0700 Date: Mon, 26 Jun 2023 18:46:40 +0100 From: "Leif Lindholm" To: Ard Biesheuvel CC: , Sami Mujawar , Sumit Garg Subject: Re: [PATCH 3/3] ArmPkg/OpteeLib: Map shared communication buffer non-executable Message-ID: References: <20230626083644.1011698-1-ardb@kernel.org> <20230626083644.1011698-4-ardb@kernel.org> MIME-Version: 1.0 In-Reply-To: <20230626083644.1011698-4-ardb@kernel.org> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: FxG7AC_hqBhAjznux5uD22qeRLGJq2il X-Proofpoint-ORIG-GUID: FxG7AC_hqBhAjznux5uD22qeRLGJq2il X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-26_14,2023-06-26_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=671 clxscore=1011 bulkscore=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 spamscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306260163 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Mon, Jun 26, 2023 at 10:36:44 +0200, Ard Biesheuvel wrote: > The OP-TEE secure OS exposes a non-secure memory region for > communication between the secure OS itself and any clients in the > non-secure firmware. This memory is writable by non-secure and is not > used for code only data, and so it should be mapped non-executable. > > Signed-off-by: Ard Biesheuvel This looks straightforward enough (and an important safety improvement), but adding Sumit on cc as original author. >>From my side, for the series: Reviewed-by: Leif Lindholm > --- > ArmPkg/Library/OpteeLib/Optee.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/ArmPkg/Library/OpteeLib/Optee.c b/ArmPkg/Library/OpteeLib/Optee.c > index 46464f17ef06653e..3acf172b68a2d34c 100644 > --- a/ArmPkg/Library/OpteeLib/Optee.c > +++ b/ArmPkg/Library/OpteeLib/Optee.c > @@ -86,7 +86,12 @@ OpteeSharedMemoryRemap ( > return EFI_BUFFER_TOO_SMALL; > } > > - Status = ArmSetMemoryAttributes (PhysicalAddress, Size, EFI_MEMORY_WB, 0); > + Status = ArmSetMemoryAttributes ( > + PhysicalAddress, > + Size, > + EFI_MEMORY_WB | EFI_MEMORY_XP, > + 0 > + ); > if (EFI_ERROR (Status)) { > return Status; > } > -- > 2.39.2 >