casaroli commented on code in PR #21473: URL: https://github.com/apache/nuttx/pull/21473#discussion_r4478017636
########## drivers/pipes/fifo.c: ########## @@ -102,6 +104,13 @@ int nx_mkfifo(FAR const char *pathname, mode_t mode, size_t bufsize) FAR struct pipe_dev_s *dev; int ret; + /* Read the path before anything is held: a bad pointer faults here */ + + if (strnlen(pathname, PATH_MAX) == 0) Review Comment: `pathname[0]` reads one byte. A path that runs off a mapped page into an unmapped page passes that check and faults later in `inode_reserve()` with the lock held: the "cross" rows of the test table. `inode_search_setup()` reads the whole string anyway. -- 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]
