You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/06/28 04:09:43 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request #3985: mmap: Implement the minial but reasonable mlock/munlock/mprotect

xiaoxiang781216 opened a new pull request #3985:
URL: https://github.com/apache/incubator-nuttx/pull/3985


   ## Summary
   
   ## Impact
   New API is added
   
   ## Testing
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #3985: mmap: Implement the minial but reasonable mlock/munlock/mprotect

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #3985:
URL: https://github.com/apache/incubator-nuttx/pull/3985#discussion_r661299620



##########
File path: fs/mmap/fs_mmap.c
##########
@@ -132,8 +132,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
    * logic is not in place.
    */
 
-  if (prot == PROT_NONE ||
-      (flags & (MAP_FIXED | MAP_DENYWRITE)) != 0)
+  if ((flags & (MAP_FIXED | MAP_DENYWRITE)) != 0)

Review comment:
       doesn't mprotect need a permission check then?




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #3985: mmap: Implement the minial but reasonable mlock/munlock/mprotect

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #3985:
URL: https://github.com/apache/incubator-nuttx/pull/3985#discussion_r661346682



##########
File path: fs/mmap/fs_mmap.c
##########
@@ -132,8 +132,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
    * logic is not in place.
    */
 
-  if (prot == PROT_NONE ||
-      (flags & (MAP_FIXED | MAP_DENYWRITE)) != 0)
+  if ((flags & (MAP_FIXED | MAP_DENYWRITE)) != 0)

Review comment:
       ok




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #3985: mmap: Implement the minial but reasonable mlock/munlock/mprotect

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #3985:
URL: https://github.com/apache/incubator-nuttx/pull/3985#discussion_r661291462



##########
File path: fs/mmap/fs_mmap.c
##########
@@ -132,8 +132,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
    * logic is not in place.
    */
 
-  if (prot == PROT_NONE ||
-      (flags & (MAP_FIXED | MAP_DENYWRITE)) != 0)
+  if ((flags & (MAP_FIXED | MAP_DENYWRITE)) != 0)

Review comment:
       Since the caller may set PROT_NONE initially and then change to PROT_WRITE/PROT_READ... by mprotect later.




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #3985: mmap: Implement the minial but reasonable mlock/munlock/mprotect

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #3985:
URL: https://github.com/apache/incubator-nuttx/pull/3985#discussion_r661331752



##########
File path: fs/mmap/fs_mmap.c
##########
@@ -132,8 +132,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
    * logic is not in place.
    */
 
-  if (prot == PROT_NONE ||
-      (flags & (MAP_FIXED | MAP_DENYWRITE)) != 0)
+  if ((flags & (MAP_FIXED | MAP_DENYWRITE)) != 0)

Review comment:
       Yes, but we need save file pointer to check, this will be part of the next patch which not only fix the permission check, but also save the dirty data to the storage.




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 merged pull request #3985: mmap: Implement the minial but reasonable mlock/munlock/mprotect

Posted by GitBox <gi...@apache.org>.
masayuki2009 merged pull request #3985:
URL: https://github.com/apache/incubator-nuttx/pull/3985


   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #3985: mmap: Implement the minial but reasonable mlock/munlock/mprotect

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #3985:
URL: https://github.com/apache/incubator-nuttx/pull/3985#discussion_r661242150



##########
File path: fs/mmap/fs_mmap.c
##########
@@ -132,8 +132,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
    * logic is not in place.
    */
 
-  if (prot == PROT_NONE ||
-      (flags & (MAP_FIXED | MAP_DENYWRITE)) != 0)
+  if ((flags & (MAP_FIXED | MAP_DENYWRITE)) != 0)

Review comment:
       can you explain this change?




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org