Skip to content

Commit 2f2eaf7

Browse files
peter-mitsiskartben
authored andcommitted
arch: xtensa: Update arch_user_string_nlen()
When calling device_get_binding(NULL) from userspace, this eventually funnels down to a call to arch_user_string_nlen() where it tried to verify that the kernel has access to this address (0x0). But since this originates from userspace, we really want to know if this is accessible from userspace, so using arch_buffer_validate() instead of xtensa_mem_kernel_has_access() is preferable. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
1 parent dde9462 commit 2f2eaf7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/xtensa/core/syscall_helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ size_t arch_user_string_nlen(const char *s, size_t maxsize, int *err_arg)
115115
* For MPU systems, this would simply results in access errors
116116
* and the exception handler will terminate the thread.
117117
*/
118-
if (!xtensa_mem_kernel_has_access(s, maxsize, 0)) {
118+
if (arch_buffer_validate(s, maxsize, 0)) {
119119
/*
120120
* API says we need to set err_arg to -1 if there are
121121
* any errors.

0 commit comments

Comments
 (0)