aboutgitcodelistschat:MatrixIRC
path: root/common
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-05-22 17:03:08 +0200
committerStefano Brivio <sbrivio@redhat.com>2023-06-01 11:10:27 +0200
commitbb47d77d316137c9deddd46135b22dc144ae1ea9 (patch)
tree3e92e7ba5f912c3a384804d3f99128ddc1cf0bc8 /common
parent6b1cb05624ad0f419fda5ab001ed3051273e1d4b (diff)
downloadseitan-bb47d77d316137c9deddd46135b22dc144ae1ea9.tar
seitan-bb47d77d316137c9deddd46135b22dc144ae1ea9.tar.gz
seitan-bb47d77d316137c9deddd46135b22dc144ae1ea9.tar.bz2
seitan-bb47d77d316137c9deddd46135b22dc144ae1ea9.tar.lz
seitan-bb47d77d316137c9deddd46135b22dc144ae1ea9.tar.xz
seitan-bb47d77d316137c9deddd46135b22dc144ae1ea9.tar.zst
seitan-bb47d77d316137c9deddd46135b22dc144ae1ea9.zip
ops: adjust op_call
Diffstat (limited to 'common')
-rw-r--r--common/common.c2
-rw-r--r--common/gluten.h16
2 files changed, 13 insertions, 5 deletions
diff --git a/common/common.c b/common/common.c
index cd792de..f67f175 100644
--- a/common/common.c
+++ b/common/common.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
#include <stddef.h>
#include <stdio.h>
#include <string.h>
@@ -11,6 +12,7 @@
#include <linux/audit.h>
#include <linux/seccomp.h>
+#include <linux/limits.h>
#include "util.h"
#include "common.h"
diff --git a/common/gluten.h b/common/gluten.h
index 9bd4689..6c0fc25 100644
--- a/common/gluten.h
+++ b/common/gluten.h
@@ -33,6 +33,7 @@ extern struct seccomp_data anonymous_seccomp_data;
#define NO_FIELD block
#define NS_NUM sizeof(enum ns_type)
+#define GET_BIT(x, i) (((x) & (1UL << (i))) != 0)
enum gluten_offset_type {
OFFSET_RO_DATA = 0,
@@ -113,12 +114,17 @@ struct op_nr {
struct gluten_offset no_match;
};
+struct syscall_desc {
+ unsigned nr : 9;
+ unsigned arg_count : 3;
+ unsigned has_ret : 1;
+ unsigned arg_deref : 6;
+ struct gluten_offset data[];
+};
+
struct op_call {
- struct gluten_offset nr;
- struct gluten_offset args[6];
- struct op_context context;
- struct gluten_offset ret;
- bool has_ret;
+ struct gluten_offset syscall;
+ struct gluten_offset context;
};
struct op_block {