igrr commented on code in PR #19772:
URL: https://github.com/apache/nuttx/pull/19772#discussion_r3759266892


##########
arch/xtensa/src/esp32s3/Make.defs:
##########
@@ -43,6 +43,25 @@ ifeq ($(CONFIG_BUILD_PROTECTED),y)
 CHIP_CSRCS += esp32s3_userspace.c
 endif
 
+# The MMU/PMS/WCL primitives back both the protected user split and the
+# BUILD_KERNEL address-environment remap.
+
+ifneq ($(filter y,$(CONFIG_BUILD_PROTECTED) $(CONFIG_ARCH_ADDRENV)),)
+CHIP_CSRCS += esp32s3_mmu.c esp32s3_pms.c esp32s3_wcl.c

Review Comment:
   The PMS primitives are compiled in case of CONFIG_ARCH_ADDRENV, but they 
only seem to be called from esp32s3_userspace.c, which is included only if 
CONFIG_BUILD_PROTECTED=y.
   
   So right now in case of BUILD_KERNEL, PMS doesn't get enabled, and user 
processes can freely access kernel memory.
   
   (Seems like esp32s3_pmsirqinitialize doesn't get called in case of 
BUILD_KERNEL, either)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to