royzah commented on code in PR #20412: URL: https://github.com/apache/nuttx/pull/20412#discussion_r4163905558
########## 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: done, all uaccess_ now: uaccess_ok, uaccess_check, uaccess_fault ########## 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: u right, nothing even called it. dropped it, both sides just use uaccess_ok ########## 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: can do, but userspace_s only has the image ranges (text/data/bss). user heap and stacks differ per arch, on arm the heap runs from us_bssend to end of ram and us_heapend isnt set, so it'd be those ranges + mm_heapmember() on the user heap. also sched/addrenv only builds with ARCH_ADDRENV. since nothing calls uaccess_ok in this PR yet, ok if I add the protected version in the next one together with its callers? -- 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]
