aboutgitcodelistschat:MatrixIRC
path: root/common
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-05-11 11:26:11 +0200
committerAlice Frosi <afrosi@redhat.com>2023-05-11 17:48:29 +0200
commit46a3a54c0a0e1ce9d8f5705184e46386565d2319 (patch)
tree37b92e09745d9e02d98406d2f9bdc92c1fa818fc /common
parent1b40d186058e1c8c16a9fe0ada522e2a6dee37a0 (diff)
downloadseitan-46a3a54c0a0e1ce9d8f5705184e46386565d2319.tar
seitan-46a3a54c0a0e1ce9d8f5705184e46386565d2319.tar.gz
seitan-46a3a54c0a0e1ce9d8f5705184e46386565d2319.tar.bz2
seitan-46a3a54c0a0e1ce9d8f5705184e46386565d2319.tar.lz
seitan-46a3a54c0a0e1ce9d8f5705184e46386565d2319.tar.xz
seitan-46a3a54c0a0e1ce9d8f5705184e46386565d2319.tar.zst
seitan-46a3a54c0a0e1ce9d8f5705184e46386565d2319.zip
Adjust op_call with gluten_offset
Diffstat (limited to 'common')
-rw-r--r--common/gluten.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/common/gluten.h b/common/gluten.h
index f6be7bb..3df638e 100644
--- a/common/gluten.h
+++ b/common/gluten.h
@@ -28,6 +28,8 @@ extern struct seccomp_data anonymous_seccomp_data;
MAX(MAX(MAX(DATA_SIZE, RO_DATA_SIZE), INST_MAX), \
ARRAY_SIZE(anonymous_seccomp_data.args))
+#define OP_EMPTY { .block = { -1 } }
+#define NO_FIELD block
enum gluten_offset_type {
OFFSET_RO_DATA = 0,
@@ -50,17 +52,18 @@ BUILD_BUG_ON(BITS_PER_NUM(OFFSET_TYPE_MAX) + BITS_PER_NUM(OFFSET_MAX) > 16)
enum ns_spec_type {
NS_NONE,
+ /* Read the pid from seccomp_data */
NS_SPEC_TARGET,
+ /* Read the pid from gluten */
NS_SPEC_PID,
NS_SPEC_PATH,
};
struct ns_spec {
enum ns_spec_type type;
- union {
- pid_t pid;
- char *path;
- } id;
+ /* Pid or path based on the type */
+ struct gluten_offset id;
+ size_t size;
};
/*
@@ -99,26 +102,22 @@ enum op_type {
};
struct op_nr {
- long nr;
+ struct gluten_offset nr;
struct gluten_offset no_match;
};
struct op_call {
- long nr;
- bool has_ret;
- void *args[6];
+ struct gluten_offset nr;
+ struct gluten_offset args[6];
struct op_context context;
struct gluten_offset ret;
+ bool has_ret;
};
struct op_block {
int32_t error;
};
-struct op_continue {
- bool cont;
-};
-
struct op_return {
struct gluten_offset val;
};
@@ -163,7 +162,6 @@ struct op {
union {
struct op_nr nr;
struct op_call call;
- struct op_continue cont;
struct op_block block;
struct op_return ret;
struct op_inject inject;