diff options
author | Alice Frosi <afrosi@redhat.com> | 2023-06-19 14:28:45 +0200 |
---|---|---|
committer | Alice Frosi <afrosi@redhat.com> | 2023-06-28 14:21:26 +0200 |
commit | 4a1430ac3c60b5ff1c00bf98c004351c67c26c23 (patch) | |
tree | 648273310014d06e5e42f6b850866afbae653057 | |
parent | 64d64ab33a7cb073492013258ed3e465d3358cbd (diff) | |
download | seitan-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/bpf | bin | 0 -> 56 bytes | |||
-rw-r--r-- | demo/connect.bpf | bin | 0 -> 56 bytes | |||
-rw-r--r-- | demo/connect.gluten | bin | 0 -> 262144 bytes | |||
-rw-r--r-- | demo/connect1.hjson | 8 | ||||
-rw-r--r-- | demo/eater.pid | 1 | ||||
-rw-r--r-- | demo/ioctl.bpf | bin | 0 -> 56 bytes | |||
-rw-r--r-- | demo/ioctl.gluten | bin | 0 -> 262144 bytes | |||
-rw-r--r-- | demo/mknod. | bin | 0 -> 72 bytes | |||
-rw-r--r-- | demo/mknod.bpf | bin | 0 -> 72 bytes | |||
-rw-r--r-- | demo/mknod.gluten | bin | 0 -> 262144 bytes | |||
-rw-r--r-- | demo/mknod.hjson | 2 | ||||
-rw-r--r-- | demo/mknod.hjson.bak | 33 | ||||
-rw-r--r-- | demo/mknod_cont.hjson | 63 | ||||
-rw-r--r-- | demo/read.bpf | bin | 0 -> 56 bytes | |||
-rw-r--r-- | demo/read.gluten | bin | 0 -> 262144 bytes | |||
-rw-r--r-- | demo/socket.bpf | bin | 0 -> 80 bytes | |||
-rw-r--r-- | demo/socket.gluten | bin | 0 -> 262144 bytes | |||
-rw-r--r-- | demo/socket.hjson | 11 |
18 files changed, 113 insertions, 5 deletions
diff --git a/demo/bpf b/demo/bpf Binary files differnew file mode 100644 index 0000000..ad1fbf9 --- /dev/null +++ b/demo/bpf diff --git a/demo/connect.bpf b/demo/connect.bpf Binary files differnew file mode 100644 index 0000000..ad1fbf9 --- /dev/null +++ b/demo/connect.bpf diff --git a/demo/connect.gluten b/demo/connect.gluten Binary files differnew file mode 100644 index 0000000..0a66814 --- /dev/null +++ b/demo/connect.gluten 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 Binary files differnew file mode 100644 index 0000000..3064f8b --- /dev/null +++ b/demo/ioctl.bpf diff --git a/demo/ioctl.gluten b/demo/ioctl.gluten Binary files differnew file mode 100644 index 0000000..df179c5 --- /dev/null +++ b/demo/ioctl.gluten diff --git a/demo/mknod. b/demo/mknod. Binary files differnew file mode 100644 index 0000000..500cbce --- /dev/null +++ b/demo/mknod. diff --git a/demo/mknod.bpf b/demo/mknod.bpf Binary files differnew file mode 100644 index 0000000..500cbce --- /dev/null +++ b/demo/mknod.bpf diff --git a/demo/mknod.gluten b/demo/mknod.gluten Binary files differnew file mode 100644 index 0000000..13fdaeb --- /dev/null +++ b/demo/mknod.gluten 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 Binary files differnew file mode 100644 index 0000000..53eb58f --- /dev/null +++ b/demo/read.bpf diff --git a/demo/read.gluten b/demo/read.gluten Binary files differnew file mode 100644 index 0000000..eff29c4 --- /dev/null +++ b/demo/read.gluten diff --git a/demo/socket.bpf b/demo/socket.bpf Binary files differnew file mode 100644 index 0000000..0d4a8f1 --- /dev/null +++ b/demo/socket.bpf diff --git a/demo/socket.gluten b/demo/socket.gluten Binary files differnew file mode 100644 index 0000000..1c45e12 --- /dev/null +++ b/demo/socket.gluten 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 } } ] |