diff options
Diffstat (limited to 'cooker')
-rw-r--r-- | cooker/Makefile | 2 | ||||
-rw-r--r-- | cooker/call.c | 2 | ||||
-rw-r--r-- | cooker/call.h | 2 | ||||
-rw-r--r-- | cooker/calls.c | 2 | ||||
-rw-r--r-- | cooker/calls.h | 2 | ||||
-rw-r--r-- | cooker/calls/fs.c | 2 | ||||
-rw-r--r-- | cooker/calls/fs.h | 2 | ||||
-rw-r--r-- | cooker/calls/ioctl.c | 310 | ||||
-rw-r--r-- | cooker/calls/ioctl.h | 2 | ||||
-rw-r--r-- | cooker/calls/net.c | 4 | ||||
-rw-r--r-- | cooker/calls/net.h | 2 | ||||
-rw-r--r-- | cooker/calls/process.c | 2 | ||||
-rw-r--r-- | cooker/calls/process.h | 2 | ||||
-rw-r--r-- | cooker/cooker.h | 2 | ||||
-rw-r--r-- | cooker/emit.c | 2 | ||||
-rw-r--r-- | cooker/emit.h | 2 | ||||
-rw-r--r-- | cooker/example.hjson | 3 | ||||
-rw-r--r-- | cooker/example.hjson.license | 2 | ||||
-rw-r--r-- | cooker/filter.c | 2 | ||||
-rw-r--r-- | cooker/filter.h | 2 | ||||
-rw-r--r-- | cooker/gluten.c | 2 | ||||
-rw-r--r-- | cooker/gluten.h | 2 | ||||
-rw-r--r-- | cooker/main.c | 2 | ||||
-rw-r--r-- | cooker/match.c | 2 | ||||
-rw-r--r-- | cooker/match.h | 2 | ||||
-rw-r--r-- | cooker/parse.c | 2 | ||||
-rw-r--r-- | cooker/parse.h | 2 |
27 files changed, 183 insertions, 182 deletions
diff --git a/cooker/Makefile b/cooker/Makefile index 823e6db..64342dc 100644 --- a/cooker/Makefile +++ b/cooker/Makefile @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: GPL-3.0-or-later +# SPDX-License-Identifier: GPL-2.0-or-later # # seitan - Syscall Expressive Interpreter, Transformer and Notifier # diff --git a/cooker/call.c b/cooker/call.c index 05e0e55..6182a5b 100644 --- a/cooker/call.c +++ b/cooker/call.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* seitan - Syscall Expressive Interpreter, Transformer and Notifier * diff --git a/cooker/call.h b/cooker/call.h index 3c0eb09..435288f 100644 --- a/cooker/call.h +++ b/cooker/call.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Stefano Brivio <sbrivio@redhat.com> */ diff --git a/cooker/calls.c b/cooker/calls.c index 783c3f6..337ea21 100644 --- a/cooker/calls.c +++ b/cooker/calls.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* seitan - Syscall Expressive Interpreter, Transformer and Notifier * diff --git a/cooker/calls.h b/cooker/calls.h index 5d46e14..8385527 100644 --- a/cooker/calls.h +++ b/cooker/calls.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Stefano Brivio <sbrivio@redhat.com> */ diff --git a/cooker/calls/fs.c b/cooker/calls/fs.c index 924907d..013dacf 100644 --- a/cooker/calls/fs.c +++ b/cooker/calls/fs.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* seitan - Syscall Expressive Interpreter, Transformer and Notifier * diff --git a/cooker/calls/fs.h b/cooker/calls/fs.h index 2e3c06b..ad2f218 100644 --- a/cooker/calls/fs.h +++ b/cooker/calls/fs.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Stefano Brivio <sbrivio@redhat.com> */ diff --git a/cooker/calls/ioctl.c b/cooker/calls/ioctl.c index a60b834..c9f01d0 100644 --- a/cooker/calls/ioctl.c +++ b/cooker/calls/ioctl.c @@ -1,155 +1,155 @@ -// SPDX-License-Identifier: GPL-3.0-or-later
-
-/* seitan - Syscall Expressive Interpreter, Transformer and Notifier
- *
- * cooker/calls/ioctl.c - Description of known ioctl(2) requests
- *
- * Copyright 2023 Red Hat GmbH
- * Authors: Alice Frosi <afrosi@redhat.com>
- * Stefano Brivio <sbrivio@redhat.com>
- */
-
-/*
-fd = ioctl_ns(fd, request)
-n = ioctl_tty(fd, cmd, argp)
-e = ioctl_iflags(fd, cmd, attr)
-*/
-
-#include <asm-generic/unistd.h>
-#include <sys/syscall.h>
-
-#include <sys/ioctl.h>
-#include <termios.h>
-#include <linux/fs.h>
-#include <linux/nsfs.h>
-
-#include <net/if.h>
-#include <linux/if.h>
-#include <linux/if_tun.h>
-
-#include "../cooker.h"
-#include "../calls.h"
-
-static struct num request[] = {
- { "FS_IOC_GETFLAGS", FS_IOC_GETFLAGS }, /* ioctl_iflags */
- { "FS_IOC_SETFLAGS", FS_IOC_SETFLAGS },
-
- { "NS_GET_USERNS", NS_GET_USERNS }, /* ioctl_ns*/
- { "NS_GET_PARENT", NS_GET_PARENT },
-
- { "TCGETS", TCGETS }, /* ioctl_tty */
- { "TCSETS", TCSETS },
- { "TCSETSW", TCSETSW },
- { "TCSETSF", TCSETSF },
-
- { "TUNSETIFF", TUNSETIFF }, /* no man page? */
-
- { 0 },
-};
-
-static struct num attr[] = {
- { "FS_APPEND_FL", FS_APPEND_FL },
- { "FS_COMPR_FL", FS_COMPR_FL },
- { "FS_DIRSYNC_FL", FS_DIRSYNC_FL },
- { "FS_IMMUTABLE_FL", FS_IMMUTABLE_FL },
- { "FS_JOURNAL_DATA_FL", FS_JOURNAL_DATA_FL },
- { "FS_NOATIME_FL", FS_NOATIME_FL },
- { "FS_NOCOW_FL", FS_NOCOW_FL },
- { "FS_NODUMP_FL", FS_NODUMP_FL },
- { "FS_NOTAIL_FL", FS_NOTAIL_FL },
- { "FS_PROJINHERIT_FL", FS_PROJINHERIT_FL },
- { "FS_SECRM_FL", FS_SECRM_FL },
- { "FS_SYNC_FL", FS_SYNC_FL },
- { "FS_TOPDIR_FL", FS_TOPDIR_FL },
- { "FS_UNRM_FL", FS_UNRM_FL },
-};
-
-static struct num tun_ifr_flags[] = {
- { "IFF_TUN", IFF_TUN },
- { 0 },
-};
-
-static struct field tun_ifr[] = { /* netdevice(7) */
- {
- "name", STRING, 0,
- offsetof(struct ifreq, ifr_name),
- IFNAMSIZ, { 0 },
- },
- {
- "flags", INT, /* One allowed at a time? */ 0,
- offsetof(struct ifreq, ifr_flags),
- 0, { .d_num = tun_ifr_flags },
- },
-};
-
-static struct select_num ioctl_request_arg[] = {
- { FS_IOC_GETFLAGS,
- { 2,
- {
- "argp", INT, FLAGS,
- sizeof(int), 0,
- { .d_num = attr }
- }
- }
- },
- { FS_IOC_SETFLAGS,
- { 2,
- {
- "argp", INT, FLAGS,
- sizeof(int), 0,
- { .d_num = attr }
- }
- }
- },
- { TUNSETIFF,
- { 2,
- {
- "ifr", STRUCT, 0,
- sizeof(struct ifreq), 0,
- { .d_struct = tun_ifr }
- }
- }
- },
- { 0 },
-};
-
-static struct field ioctl_request = {
- "request", INT, 0, 0, 0, { .d_num = request },
-};
-
-static struct select ioctl_request_select = {
- &ioctl_request, { .d_num = ioctl_request_arg }
-};
-
-static struct arg ioctl_args[] = {
- { 0,
- {
- "path", FDPATH, 0, 0, 0,
- { 0 }
- }
- },
- { 0,
- {
- "fd", INT, 0, 0, 0,
- { 0 }
- }
- },
- { 1,
- {
- "request", SELECT, 0, 0, 0,
- { .d_select = &ioctl_request_select }
- }
- },
- { 2,
- {
- "arg", SELECTED, 0, -1, 0,
- { 0 }
- }
- },
- { 0 },
-};
-
-struct call syscalls_ioctl[] = {
- { __NR_ioctl, "ioctl", ioctl_args },
- { 0 },
-};
+// SPDX-License-Identifier: GPL-2.0-or-later + +/* seitan - Syscall Expressive Interpreter, Transformer and Notifier + * + * cooker/calls/ioctl.c - Description of known ioctl(2) requests + * + * Copyright 2023 Red Hat GmbH + * Authors: Alice Frosi <afrosi@redhat.com> + * Stefano Brivio <sbrivio@redhat.com> + */ + +/* +fd = ioctl_ns(fd, request) +n = ioctl_tty(fd, cmd, argp) +e = ioctl_iflags(fd, cmd, attr) +*/ + +#include <asm-generic/unistd.h> +#include <sys/syscall.h> + +#include <sys/ioctl.h> +#include <termios.h> +#include <linux/fs.h> +#include <linux/nsfs.h> + +#include <net/if.h> +#include <linux/if.h> +#include <linux/if_tun.h> + +#include "../cooker.h" +#include "../calls.h" + +static struct num request[] = { + { "FS_IOC_GETFLAGS", FS_IOC_GETFLAGS }, /* ioctl_iflags */ + { "FS_IOC_SETFLAGS", FS_IOC_SETFLAGS }, + + { "NS_GET_USERNS", NS_GET_USERNS }, /* ioctl_ns*/ + { "NS_GET_PARENT", NS_GET_PARENT }, + + { "TCGETS", TCGETS }, /* ioctl_tty */ + { "TCSETS", TCSETS }, + { "TCSETSW", TCSETSW }, + { "TCSETSF", TCSETSF }, + + { "TUNSETIFF", TUNSETIFF }, /* no man page? */ + + { 0 }, +}; + +static struct num attr[] = { + { "FS_APPEND_FL", FS_APPEND_FL }, + { "FS_COMPR_FL", FS_COMPR_FL }, + { "FS_DIRSYNC_FL", FS_DIRSYNC_FL }, + { "FS_IMMUTABLE_FL", FS_IMMUTABLE_FL }, + { "FS_JOURNAL_DATA_FL", FS_JOURNAL_DATA_FL }, + { "FS_NOATIME_FL", FS_NOATIME_FL }, + { "FS_NOCOW_FL", FS_NOCOW_FL }, + { "FS_NODUMP_FL", FS_NODUMP_FL }, + { "FS_NOTAIL_FL", FS_NOTAIL_FL }, + { "FS_PROJINHERIT_FL", FS_PROJINHERIT_FL }, + { "FS_SECRM_FL", FS_SECRM_FL }, + { "FS_SYNC_FL", FS_SYNC_FL }, + { "FS_TOPDIR_FL", FS_TOPDIR_FL }, + { "FS_UNRM_FL", FS_UNRM_FL }, +}; + +static struct num tun_ifr_flags[] = { + { "IFF_TUN", IFF_TUN }, + { 0 }, +}; + +static struct field tun_ifr[] = { /* netdevice(7) */ + { + "name", STRING, 0, + offsetof(struct ifreq, ifr_name), + IFNAMSIZ, { 0 }, + }, + { + "flags", INT, /* One allowed at a time? */ 0, + offsetof(struct ifreq, ifr_flags), + 0, { .d_num = tun_ifr_flags }, + }, +}; + +static struct select_num ioctl_request_arg[] = { + { FS_IOC_GETFLAGS, + { 2, + { + "argp", INT, FLAGS, + sizeof(int), 0, + { .d_num = attr } + } + } + }, + { FS_IOC_SETFLAGS, + { 2, + { + "argp", INT, FLAGS, + sizeof(int), 0, + { .d_num = attr } + } + } + }, + { TUNSETIFF, + { 2, + { + "ifr", STRUCT, 0, + sizeof(struct ifreq), 0, + { .d_struct = tun_ifr } + } + } + }, + { 0 }, +}; + +static struct field ioctl_request = { + "request", INT, 0, 0, 0, { .d_num = request }, +}; + +static struct select ioctl_request_select = { + &ioctl_request, { .d_num = ioctl_request_arg } +}; + +static struct arg ioctl_args[] = { + { 0, + { + "path", FDPATH, 0, 0, 0, + { 0 } + } + }, + { 0, + { + "fd", INT, 0, 0, 0, + { 0 } + } + }, + { 1, + { + "request", SELECT, 0, 0, 0, + { .d_select = &ioctl_request_select } + } + }, + { 2, + { + "arg", SELECTED, 0, -1, 0, + { 0 } + } + }, + { 0 }, +}; + +struct call syscalls_ioctl[] = { + { __NR_ioctl, "ioctl", ioctl_args }, + { 0 }, +}; diff --git a/cooker/calls/ioctl.h b/cooker/calls/ioctl.h index a06a9bc..7072111 100644 --- a/cooker/calls/ioctl.h +++ b/cooker/calls/ioctl.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Stefano Brivio <sbrivio@redhat.com> */ diff --git a/cooker/calls/net.c b/cooker/calls/net.c index 52ebc1e..746a08e 100644 --- a/cooker/calls/net.c +++ b/cooker/calls/net.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* seitan - Syscall Expressive Interpreter, Transformer and Notifier * @@ -228,7 +228,7 @@ static struct arg connect_args[] = { { "addr", SELECT, 0, 0, - sizeof(struct sockaddr_storage), + sizeof(struct sockaddr_un), { .d_select = &connect_addr_select }, }, }, diff --git a/cooker/calls/net.h b/cooker/calls/net.h index 105bf4a..7eb852d 100644 --- a/cooker/calls/net.h +++ b/cooker/calls/net.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Stefano Brivio <sbrivio@redhat.com> */ diff --git a/cooker/calls/process.c b/cooker/calls/process.c index b133629..b7a92f0 100644 --- a/cooker/calls/process.c +++ b/cooker/calls/process.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* seitan - Syscall Expressive Interpreter, Transformer and Notifier * diff --git a/cooker/calls/process.h b/cooker/calls/process.h index 5e214ef..c7d81bb 100644 --- a/cooker/calls/process.h +++ b/cooker/calls/process.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Stefano Brivio <sbrivio@redhat.com> */ diff --git a/cooker/cooker.h b/cooker/cooker.h index 1b9d9dd..c59a5dc 100644 --- a/cooker/cooker.h +++ b/cooker/cooker.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Stefano Brivio <sbrivio@redhat.com> */ diff --git a/cooker/emit.c b/cooker/emit.c index b518ff9..e2b5461 100644 --- a/cooker/emit.c +++ b/cooker/emit.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* seitan - Syscall Expressive Interpreter, Transformer and Notifier * diff --git a/cooker/emit.h b/cooker/emit.h index 70997fc..31c3378 100644 --- a/cooker/emit.h +++ b/cooker/emit.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Stefano Brivio <sbrivio@redhat.com> */ diff --git a/cooker/example.hjson b/cooker/example.hjson index f445418..b161449 100644 --- a/cooker/example.hjson +++ b/cooker/example.hjson @@ -7,7 +7,8 @@ { "socket": { "family": "unix", "type": "stream", "flags": 0, "protocol": 0 }, "ret": "new_fd" }, { "connect": { "fd": { "tag": { "get": "new_fd" } }, "addr": { "family": "unix", "path": "/var/run/pr-helper.sock" } }, "ret": "y" } ], - "fd": { "src": { "tag": "new_fd" }, "new": { "tag": "orig_fd" }, "return": true, "close_on_exec": false } + "fd": { "src": { "tag": "new_fd" }, "new": { "tag": "orig_fd" }, "close_on_exec": false }, + "return": { "tag": "y" } }, { "match": [ /* qemu creates a tap interface */ diff --git a/cooker/example.hjson.license b/cooker/example.hjson.license index 2e3bd69..d2abc50 100644 --- a/cooker/example.hjson.license +++ b/cooker/example.hjson.license @@ -1,2 +1,2 @@ SPDX-FileCopyrightText: 2023 Red Hat GmbH <sbrivio@redhat.com> -SPDX-License-Identifier: GPL-3.0-or-later +SPDX-License-Identifier: GPL-2.0-or-later diff --git a/cooker/filter.c b/cooker/filter.c index 77961d0..8754da0 100644 --- a/cooker/filter.c +++ b/cooker/filter.c @@ -1,5 +1,5 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Alice Frosi <afrosi@redhat.com> */ diff --git a/cooker/filter.h b/cooker/filter.h index 7f6ddfd..fca9da7 100644 --- a/cooker/filter.h +++ b/cooker/filter.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Alice Frosi <afrosi@redhat.com> */ diff --git a/cooker/gluten.c b/cooker/gluten.c index cc317d3..a488dfd 100644 --- a/cooker/gluten.c +++ b/cooker/gluten.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* seitan - Syscall Expressive Interpreter, Transformer and Notifier * diff --git a/cooker/gluten.h b/cooker/gluten.h index 0fcea26..17d762b 100644 --- a/cooker/gluten.h +++ b/cooker/gluten.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Stefano Brivio <sbrivio@redhat.com> */ diff --git a/cooker/main.c b/cooker/main.c index db62fcb..a1e5f7f 100644 --- a/cooker/main.c +++ b/cooker/main.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* seitan - Syscall Expressive Interpreter, Transformer and Notifier * diff --git a/cooker/match.c b/cooker/match.c index 7a4ca97..593cd55 100644 --- a/cooker/match.c +++ b/cooker/match.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* seitan - Syscall Expressive Interpreter, Transformer and Notifier * diff --git a/cooker/match.h b/cooker/match.h index 95c7b4d..6b05a86 100644 --- a/cooker/match.h +++ b/cooker/match.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Stefano Brivio <sbrivio@redhat.com> */ diff --git a/cooker/parse.c b/cooker/parse.c index 1cc6296..5a474f8 100644 --- a/cooker/parse.c +++ b/cooker/parse.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* seitan - Syscall Expressive Interpreter, Transformer and Notifier * diff --git a/cooker/parse.h b/cooker/parse.h index 361fc55..ece2848 100644 --- a/cooker/parse.h +++ b/cooker/parse.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later +/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright 2023 Red Hat GmbH * Author: Stefano Brivio <sbrivio@redhat.com> */ |