This is an automated email from the ASF dual-hosted git repository.
jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 17fad61ec49 drivers/eeprom: I2C EEPROM Read/Write Kernel Operations
Cause a Device Crash
17fad61ec49 is described below
commit 17fad61ec4969a070760eaaf537e16c5a5615bd6
Author: Catalin Visinescu <[email protected]>
AuthorDate: Sat Jul 18 19:51:53 2026 -0400
drivers/eeprom: I2C EEPROM Read/Write Kernel Operations Cause a Device Crash
If user passes NULL as buffer, the driver may crash. This is problematic
for NuttX protected and kernel builds.
Details in the issue: https://github.com/apache/nuttx/issues/19473
While this fixes the issue with a typical NULL pointer, fundamentally this
will be addressed with the implementation of access_ok().
https://man7.org/linux/man-pages/man2/access.2.html
Signed-off-by: Catalin Visinescu <[email protected]>
---
fs/vfs/fs_read.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/vfs/fs_read.c b/fs/vfs/fs_read.c
index 677a420a248..a8e50e0a546 100644
--- a/fs/vfs/fs_read.c
+++ b/fs/vfs/fs_read.c
@@ -178,15 +178,13 @@ ssize_t file_readv(FAR struct file *filep,
/* Are all iov_base accessible? */
-#if !defined(CONFIG_BUILD_KERNEL) || CONFIG_ARCH_TEXT_VBASE != 0
for (ret = 0; ret < iovcnt; ret++)
{
- if (iov[ret].iov_base == NULL && iov[ret].iov_len != 0)
+ if (iov[ret].iov_base == NULL)
{
return -EFAULT;
}
}
-#endif
ret = -EBADF;