@@ -176,6 +176,11 @@ uint64_t vhost_user_fs_slave_io(struct vhost_dev *dev, VhostUserFSSlaveMsg *sm,
return (uint64_t)-1;
}
+ if (sm->gen_flags & VHOST_USER_FS_GENFLAG_DROP_FSETID) {
+ error_report("Dropping CAP_FSETID is not supported");
+ return (uint64_t)-ENOTSUP;
+ }
+
for (i = 0; i < VHOST_USER_FS_SLAVE_ENTRIES && !res; i++) {
if (sm->len[i] == 0) {
continue;
@@ -30,7 +30,13 @@ OBJECT_DECLARE_SIMPLE_TYPE(VHostUserFS, VHOST_USER_FS)
#define VHOST_USER_FS_FLAG_MAP_R (1ull << 0)
#define VHOST_USER_FS_FLAG_MAP_W (1ull << 1)
+/* Generic flags for the overall message and not individual ranges */
+/* Drop capability CAP_FSETID during the operation */
+#define VHOST_USER_FS_GENFLAG_DROP_FSETID (1ull << 0)
+
typedef struct {
+ /* Generic flags for the overall message */
+ uint64_t gen_flags;
/* Offsets within the file being mapped */
uint64_t fd_offset[VHOST_USER_FS_SLAVE_ENTRIES];
/* Offsets within the cache */
@@ -132,7 +132,13 @@ typedef enum VhostUserSlaveRequest {
#define VHOST_USER_FS_FLAG_MAP_R (1ull << 0)
#define VHOST_USER_FS_FLAG_MAP_W (1ull << 1)
+/* Generic flags for the overall message and not individual ranges */
+/* Drop capability CAP_FSETID during the operation */
+#define VHOST_USER_FS_GENFLAG_DROP_FSETID (1ull << 0)
+
typedef struct {
+ /* Generic flags for the overall message */
+ uint64_t gen_flags;
/* Offsets within the file being mapped */
uint64_t fd_offset[VHOST_USER_FS_SLAVE_ENTRIES];
/* Offsets within the cache */