xiaoxiang781216 commented on code in PR #20412:
URL: https://github.com/apache/nuttx/pull/20412#discussion_r4162468623
##########
include/nuttx/addrenv.h:
##########
@@ -530,6 +536,16 @@ int addrenv_give(FAR struct addrenv_s *addrenv);
void addrenv_drop(FAR struct addrenv_s *addrenv, bool deferred);
+#ifdef CONFIG_BUILD_KERNEL
+bool access_ok(FAR const void *ptr, size_t len);
+bool uaccess_nested(FAR const void *parent, FAR const void *ptr);
+void uaccess_check(FAR const void *ptr, size_t len);
Review Comment:
why not use `access`, but `uaccess`
##########
include/nuttx/addrenv.h:
##########
@@ -530,6 +536,16 @@ int addrenv_give(FAR struct addrenv_s *addrenv);
void addrenv_drop(FAR struct addrenv_s *addrenv, bool deferred);
+#ifdef CONFIG_BUILD_KERNEL
Review Comment:
should we check for PRTOECTED build
##########
arch/x86_64/src/common/x86_64_addrenv.c:
##########
@@ -994,3 +994,16 @@ int up_addrenv_detach(struct tcb_s *tcb)
return OK;
}
+
+/****************************************************************************
+ * Name: up_addrenv_user_vaddr
+ *
+ * Description:
+ * Check if a virtual address is in user virtual address space.
+ *
+ ****************************************************************************/
+
+bool up_addrenv_user_vaddr(uintptr_t vaddr)
+{
+ return x86_64_uservaddr(vaddr);
Review Comment:
merge the implementation here and remove x86_64_uservaddr
##########
include/nuttx/addrenv.h:
##########
@@ -530,6 +536,16 @@ int addrenv_give(FAR struct addrenv_s *addrenv);
void addrenv_drop(FAR struct addrenv_s *addrenv, bool deferred);
+#ifdef CONFIG_BUILD_KERNEL
+bool access_ok(FAR const void *ptr, size_t len);
+bool uaccess_nested(FAR const void *parent, FAR const void *ptr);
Review Comment:
when use uaccess_nested
##########
include/nuttx/addrenv.h:
##########
@@ -540,6 +540,7 @@ void addrenv_drop(FAR struct addrenv_s *addrenv, bool
deferred);
bool access_ok(FAR const void *ptr, size_t len);
bool uaccess_nested(FAR const void *parent, FAR const void *ptr);
void uaccess_check(FAR const void *ptr, size_t len);
+void uaccess_fault(FAR const void *ptr) noreturn_function;
Review Comment:
why not move to the first patch
##########
arch/risc-v/src/common/riscv_mmu.c:
##########
@@ -41,6 +45,27 @@
* Private Functions
****************************************************************************/
+#ifdef CONFIG_BUILD_KERNEL
+static bool riscv_overlaps_user(uintptr_t vaddr, size_t size)
Review Comment:
ditto
##########
arch/arm64/src/common/arm64_mmu.c:
##########
@@ -458,6 +462,27 @@ static void split_pte_block_desc(uint64_t *pte, int level)
set_pte_table_desc(pte, new_table, level);
}
+#ifdef CONFIG_BUILD_KERNEL
+static bool arm64_overlaps_user(uintptr_t virt, size_t size)
Review Comment:
change arm64_ to is_ since arm64_ prefix does not add to the static
functions in this file
##########
tools/mksyscall.c:
##########
@@ -35,9 +35,29 @@
* Private Data
****************************************************************************/
+struct uvalue_s
+{
+ const char *name;
+ int parm;
+};
+
static bool g_inline;
static FILE *g_stubstream;
+static const char * const g_uwrapped[] =
Review Comment:
it's wrong to do the syscall special handling in the general proxy/stub
creator.
--
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]