nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

{bp-16490} fs/vfs: check if all iov_base are accessible

Open jerpelea opened this issue 6 months ago • 0 comments

Summary

Check if all iov_base are inside accessible address space. e.g.

ret = write(fd, NULL, 3);

The iov.iov_base is NULL but iov.iov_len is NOT zero.

nuttx/fs/vfs/fs_write.c

Lines 425 to 432 in dd07367 ssize_t write(int fd, FAR const void *buf, size_t nbytes) { struct iovec iov;

iov.iov_base = (void *)buf; iov.iov_len = nbytes; return writev(fd, &iov, 1); }

And, if iov.iov_base is not NULL but iov.iov_len is zero, skipped (same as Linux).

Impact

RELEASE

Testing

CI

jerpelea avatar Jun 23 '25 08:06 jerpelea