aboutgitcodelistschat:MatrixIRC
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-06-19 14:28:45 +0200
committerAlice Frosi <afrosi@redhat.com>2023-06-28 14:21:26 +0200
commit4a1430ac3c60b5ff1c00bf98c004351c67c26c23 (patch)
tree648273310014d06e5e42f6b850866afbae653057
parent64d64ab33a7cb073492013258ed3e465d3358cbd (diff)
downloadseitan-4a1430ac3c60b5ff1c00bf98c004351c67c26c23.tar
seitan-4a1430ac3c60b5ff1c00bf98c004351c67c26c23.tar.gz
seitan-4a1430ac3c60b5ff1c00bf98c004351c67c26c23.tar.bz2
seitan-4a1430ac3c60b5ff1c00bf98c004351c67c26c23.tar.lz
seitan-4a1430ac3c60b5ff1c00bf98c004351c67c26c23.tar.xz
seitan-4a1430ac3c60b5ff1c00bf98c004351c67c26c23.tar.zst
seitan-4a1430ac3c60b5ff1c00bf98c004351c67c26c23.zip
Update demos
-rw-r--r--demo/bpfbin0 -> 56 bytes
-rw-r--r--demo/connect.bpfbin0 -> 56 bytes
-rw-r--r--demo/connect.glutenbin0 -> 262144 bytes
-rw-r--r--demo/connect1.hjson8
-rw-r--r--demo/eater.pid1
-rw-r--r--demo/ioctl.bpfbin0 -> 56 bytes
-rw-r--r--demo/ioctl.glutenbin0 -> 262144 bytes
-rw-r--r--demo/mknod.bin0 -> 72 bytes
-rw-r--r--demo/mknod.bpfbin0 -> 72 bytes
-rw-r--r--demo/mknod.glutenbin0 -> 262144 bytes
-rw-r--r--demo/mknod.hjson2
-rw-r--r--demo/mknod.hjson.bak33
-rw-r--r--demo/mknod_cont.hjson63
-rw-r--r--demo/read.bpfbin0 -> 56 bytes
-rw-r--r--demo/read.glutenbin0 -> 262144 bytes
-rw-r--r--demo/socket.bpfbin0 -> 80 bytes
-rw-r--r--demo/socket.glutenbin0 -> 262144 bytes
-rw-r--r--demo/socket.hjson11
18 files changed, 113 insertions, 5 deletions
diff --git a/demo/bpf b/demo/bpf
new file mode 100644
index 0000000..ad1fbf9
--- /dev/null
+++ b/demo/bpf
Binary files differ
diff --git a/demo/connect.bpf b/demo/connect.bpf
new file mode 100644
index 0000000..ad1fbf9
--- /dev/null
+++ b/demo/connect.bpf
Binary files differ
diff --git a/demo/connect.gluten b/demo/connect.gluten
new file mode 100644
index 0000000..0a66814
--- /dev/null
+++ b/demo/connect.gluten
Binary files differ
diff --git a/demo/connect1.hjson b/demo/connect1.hjson
new file mode 100644
index 0000000..3469fc2
--- /dev/null
+++ b/demo/connect1.hjson
@@ -0,0 +1,8 @@
+[
+ { /* fake connect syscall */
+ "match": [
+ { "connect": { "addr": { "family": "unix", "path": "/fake.sock" } } }
+ ],
+ "return": 0
+ }
+]
diff --git a/demo/eater.pid b/demo/eater.pid
new file mode 100644
index 0000000..d449e42
--- /dev/null
+++ b/demo/eater.pid
@@ -0,0 +1 @@
+19188
diff --git a/demo/ioctl.bpf b/demo/ioctl.bpf
new file mode 100644
index 0000000..3064f8b
--- /dev/null
+++ b/demo/ioctl.bpf
Binary files differ
diff --git a/demo/ioctl.gluten b/demo/ioctl.gluten
new file mode 100644
index 0000000..df179c5
--- /dev/null
+++ b/demo/ioctl.gluten
Binary files differ
diff --git a/demo/mknod. b/demo/mknod.
new file mode 100644
index 0000000..500cbce
--- /dev/null
+++ b/demo/mknod.
Binary files differ
diff --git a/demo/mknod.bpf b/demo/mknod.bpf
new file mode 100644
index 0000000..500cbce
--- /dev/null
+++ b/demo/mknod.bpf
Binary files differ
diff --git a/demo/mknod.gluten b/demo/mknod.gluten
new file mode 100644
index 0000000..13fdaeb
--- /dev/null
+++ b/demo/mknod.gluten
Binary files differ
diff --git a/demo/mknod.hjson b/demo/mknod.hjson
index 40b5b8b..9124a8a 100644
--- a/demo/mknod.hjson
+++ b/demo/mknod.hjson
@@ -1,6 +1,6 @@
[
{
- "match": [ /* Giuseppe's example */
+ "match": [
{ "mknodat":
{ "path": { "tag": "path" },
"mode": { "tag": "mode" },
diff --git a/demo/mknod.hjson.bak b/demo/mknod.hjson.bak
new file mode 100644
index 0000000..7055aee
--- /dev/null
+++ b/demo/mknod.hjson.bak
@@ -0,0 +1,33 @@
+[
+ {
+ "match": [ /* Giuseppe's example */
+ { "mknodat":
+ { "path": { "tag": "path" },
+ "mode": { "tag": "mode" },
+ "type": { "tag": "type" },
+ "major": 1,
+ "minor": { "value": { "in": [ 3, 5, 7, 8, 9 ] }, "tag": "minor" }
+ }
+ },
+ { "mknod":
+ { "path": { "tag": "path" },
+ "mode": { "tag": "mode" },
+ "type": { "tag": "type" },
+ "major": 1,
+ "minor": { "value": { "in": [ 3, 5, 7, 8, 9 ] }, "tag": "minor" }
+ }
+ }
+ ],
+ "call":
+ { "mknod":
+ { "path": { "tag": { "get": "path" } },
+ "mode": { "tag": { "get": "mode" } },
+ "type": { "tag": { "get": "type" } },
+ "major": 1,
+ "minor": { "tag": { "get": "minor" } }
+ },
+ "context": { "mnt": "caller" }
+ },
+ "return": { "value": 0 }
+ }
+]
diff --git a/demo/mknod_cont.hjson b/demo/mknod_cont.hjson
new file mode 100644
index 0000000..71f41d0
--- /dev/null
+++ b/demo/mknod_cont.hjson
@@ -0,0 +1,63 @@
+[
+ {
+ "match": [
+ { "mknodat":
+ { "path": { "tag": "path" },
+ "mode": { "tag": "mode" },
+ "type": { "tag": "type" },
+ "major": 1,
+ "minor": { "value": { "in": [ 3, 5, 7, 8, 9 ] }, "tag": "minor" }
+ }
+ },
+ { "mknod":
+ { "path": { "tag": "path" },
+ "mode": { "tag": "mode" },
+ "type": { "tag": "type" },
+ "major": 1,
+ "minor": { "value": { "in": [ 3, 5, 7, 8, 9 ] }, "tag": "minor" }
+ }
+ }
+ ],
+ "call":
+ { "mknod":
+ { "path": { "tag": { "get": "path" } },
+ "mode": { "tag": { "get": "mode" } },
+ "type": { "tag": { "get": "type" } },
+ "major": 1,
+ "minor": { "tag": { "get": "minor" } }
+ },
+ "ret": "x",
+ "context": { "user": "init", "mnt": "caller" }
+ },
+ "return": { "tag": "x" }
+ }
+]
+
+/*
+ * INTFLAGS, LONGFLAGS, U32FLAGS
+ *
+ * "field": { "in": [ "ipc", "mount", "uts" ] }
+ * flags & set
+ * !!(flags & (ipc | mount | ns))
+ *
+ * "field": { "all": [ "ipc", "mount", "uts" ] }
+ * flags & set == set
+ * flags & (ipc | mount | ns) == (ipc | mount | ns)
+ *
+ * "field": { "not": [ "ipc", "mount", "uts" ] }
+ * !(flags & set)
+ *
+ * "field": { "ipc": false, "mount": true, "uts": false }
+ * flags & set == set
+ * !(flags & ipc) && (flags & mount) && !(flags & utc)
+ *
+ * "field": { "ipc" }
+ * flags == ipc
+ *
+ * INTMASK
+ * value = (target value & known values)
+ *
+ * INT, LONG, U32
+ * "arg": { "in": [ 0, 1 ] }
+ * arg == 0 || arg == 1
+ */
diff --git a/demo/read.bpf b/demo/read.bpf
new file mode 100644
index 0000000..53eb58f
--- /dev/null
+++ b/demo/read.bpf
Binary files differ
diff --git a/demo/read.gluten b/demo/read.gluten
new file mode 100644
index 0000000..eff29c4
--- /dev/null
+++ b/demo/read.gluten
Binary files differ
diff --git a/demo/socket.bpf b/demo/socket.bpf
new file mode 100644
index 0000000..0d4a8f1
--- /dev/null
+++ b/demo/socket.bpf
Binary files differ
diff --git a/demo/socket.gluten b/demo/socket.gluten
new file mode 100644
index 0000000..1c45e12
--- /dev/null
+++ b/demo/socket.gluten
Binary files differ
diff --git a/demo/socket.hjson b/demo/socket.hjson
index d9a3345..c5ddfdb 100644
--- a/demo/socket.hjson
+++ b/demo/socket.hjson
@@ -1,11 +1,14 @@
[
{
"match": [
- { "socket": { "family": "unix", "type": "stream", "flags": "cloexec", "protocol": 0 } }
+ { "socket": { "family": "unix" } }
],
- "call": [
- { "socket": { "family": "unix", "type": "stream", "flags": [ "cloexec", "nonblock" ], "protocol": 0 }, "ret": "new_fd" }
+ "return": {"continue": true }
+ },
+ {
+ "match": [
+ { "socket": {} }
],
- "fd": { "src": { "tag": "new_fd" }, "close_on_exec": false, "return": true }
+ "return": {"error": -1, "value": 0 }
}
]