haitomatic commented on PR #17161:
URL: https://github.com/apache/nuttx/pull/17161#issuecomment-3479404800
@tinnedkarma , yes I meant the protected mode which is built with
`nuttx/boards/risc-v/mpfs/icicle/configs/knsh/defconfig` ,
I think there is some issue when copying from user space buffer to kernel
space buffer
```
User space: cansend → write() → sendmsg()
↓ (system call boundary)
Kernel space: sendmsg() → psock_sendmsg() → can_sendmsg()
↓
can_sendmsg(): devif_send(dev, pstate->snd_buffer, ...)
↓
devif_send(): iob_trycopyin(dev->d_iob, buf, len, offset, false)
↓
iob_trycopyin(): iob_copyin_internal(...)
↓
iob_copyin_internal(): memcpy(dest, src, ncopy) ← **FAILURE POINT**
```
The issue isn't that user space memory is completely inaccessible, but
rather:
- Race conditions between user and kernel space
- Cache coherency problems
- MMU mapping consistency issues
Anyhow, this issue is not in the scope of this PR, I would say since it
works well now with flat mode, I would love to merge it :)
--
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]