Abhishekmishra2808 commented on code in PR #19599:
URL: https://github.com/apache/nuttx/pull/19599#discussion_r3698951127
##########
fs/mount/fs_umount2.c:
##########
@@ -110,9 +110,24 @@ int nx_umount2(FAR const char *target, unsigned int flags)
* performed, or a negated error code on a failure.
*/
- /* Hold the semaphore through the unbind logic */
+ /* Hold the inode tree lock across permission checks and unbind,
+ * matching mount()'s check-under-lock pattern.
+ */
inode_lock();
+
+ ret = inode_checksearchpath(mountpt_inode);
+ if (ret < 0)
+ {
+ goto errout_with_lock;
+ }
+
+ ret = inode_permission(mountpt_inode, W_OK);
Review Comment:
Agreed
--
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]