From 57ae74c8033153fb7e97fed797bb61ebc7a40cc5 Mon Sep 17 00:00:00 2001 From: Godzil Date: Wed, 24 Jul 2019 16:04:20 +0100 Subject: [PATCH] Update userspace to have proper protection values for mmap and send the proper flags to the callback function. --- include/fusd.h | 2 +- libfusd/libfusd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fusd.h b/include/fusd.h index 9f44dd8..ac61297 100755 --- a/include/fusd.h +++ b/include/fusd.h @@ -81,7 +81,7 @@ struct fusd_file_operations { int (*ioctl) (struct fusd_file_info *file, int request, void *data); int (*poll_diff) (struct fusd_file_info *file, unsigned int cached_state); int (*unblock) (struct fusd_file_info *file); - int (*mmap) (struct fusd_file_info *file, int offset, size_t length, int flags, void** addr, size_t* out_length); + int (*mmap) (struct fusd_file_info *file, int offset, size_t length, int prot, int flags, void** addr, size_t* out_length); } fusd_file_operations_t; diff --git a/libfusd/libfusd.c b/libfusd/libfusd.c index ac47804..b80d60d 100755 --- a/libfusd/libfusd.c +++ b/libfusd/libfusd.c @@ -503,8 +503,8 @@ static int fusd_dispatch_one(int fd, fusd_file_operations_t *fops) //printf("FUSD_MMAP\n"); if (fops && fops->mmap) { - user_retval = fops->mmap(file, msg->parm.fops_msg.offset, msg->parm.fops_msg.length, msg->parm.fops_msg.flags, - &msg->parm.fops_msg.arg.ptr_arg, &msg->parm.fops_msg.length); + user_retval = fops->mmap(file, msg->parm.fops_msg.mmoffset, msg->parm.fops_msg.length, msg->parm.fops_msg.mmprot, + msg->parm.fops_msg.mmflags, &msg->parm.fops_msg.arg.ptr_arg, &msg->parm.fops_msg.length); } break;