- 22 Jul, 2019 2 commits
-
-
Stéphane Graber authored
Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
Stéphane Graber authored
Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
- 16 Jul, 2019 2 commits
-
-
Christian Brauner authored
seccomp: open memfd read-write
-
Wolfgang Bumiller authored
Makes it easier to implement syscalls which need to write to a buffer passed by user space as a pointer. Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
- 11 Jul, 2019 11 commits
-
-
Christian Brauner authored
Adds veth router mode
-
tomponline authored
Signed-off-by:Thomas Parrott <thomas.parrott@canonical.com>
-
Thomas Parrott authored
Signed-off-by:Thomas Parrott <thomas.parrott@canonical.com>
-
Thomas Parrott authored
Defaulting to bridge mode. Signed-off-by:Thomas Parrott <thomas.parrott@canonical.com>
-
Thomas Parrott authored
Suggested usage: return error_log_errno(err, "Failed: %s", "some error"); It sets errno to the value of err, then calls SYSERROR with the format and remaining args. It always returns -1. Suggested-by:
Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by:
Thomas Parrott <thomas.parrott@canonical.com>
-
Christian Brauner authored
Suppress hardcoded table sizes
-
Rachid Koucha authored
. Use sizeof() instead of hardcoded values . snprintf(..., size, ""...) is in error if the return code is >= size (not sufficient to set only ">") Signed-off-by:Rachid Koucha <rachid.koucha@gmail.com>
-
Christian Brauner authored
Typo fix
-
Rachid Koucha authored
Fixed a typo in error message Signed-off-by:Rachid Koucha <rachid.koucha@gmail.com>
-
Christian Brauner authored
doc: Add lxc.comp.notify.cookie to Japanese lxc.container.conf(5)
-
KATOH Yasufumi authored
update for commit 214008eeSigned-off-by:
KATOH Yasufumi <karma@jazz.email.ne.jp>
-
- 10 Jul, 2019 2 commits
-
-
Stéphane Graber authored
cgroup: check for non-empty conf
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
- 09 Jul, 2019 21 commits
-
-
Stéphane Graber authored
seccomp: coding style
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Seccomp notify api update
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Wolfgang Bumiller authored
On the one hand this should close the race between the process exiting until the proxy reads the request. On the other hand it'll help the proxy quickly access info from /proc (such as ./cwd, ./ns/mnt, ...) Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
We only read the message without the cookie. For now assert that the sender also didn't try to send more by letting `recvmsg()` return the original size of the packet if it was longer. Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
and fix a minor typo Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
With the previous commit we now attempt to reconnect to the proxy in the beginning of the notify handler if we had no connection. If the connection fails later on, we now don't really need to immediately try to reconnect if we send a default response anyway (particularly if the recv() fails). (This also gives the proxy more time, for instance if it was just restarted.) Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
If a syscall happens after we already failed to communicate with the proxy, proxy_fd was -1. Before the previous commit we'd then be stuck in the state where there was no proxy registered. With the previous commit we'd send a default reply and only then try to reconnect. Improve this even further by trying to reconnect right at the start. Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
Particularly, when there's no proxy registered (iow. none configured but the seccomp profile still had a 'notify' rule), we don't want to leave them hanging. Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
If the first sendmsg() fails, try to reconnect once before failing. Otherwise if a proxy restarts while no syscall happens, the next syscall always fails with ENOSYS. Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
The container process would just hang. Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
When we fail to send a message, we send a default seccomp response and try to reconnect to the proxy. It doesn't really make much sense to retry to send the request over the new connection as the syscall has already been answered. The same goes for receiving the response - after reconnecting to the proxy, we're a new client to a potentially new proxy process, so awaiting a response without having sent a request doesn't make all too much sense either. In the future we should probably have a timeout or retry count for the entire proxy _transaction_ before sending a response to seccomp at all (and probably handle requests asynchronously). Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
The seccomp notify API has a few variables: The struct sizes are queried at runtime, and we now also have a user configured cookie. This means that with a SOCK_STREAM connection the proxy needs to carefully read() the right amount of data based on the contents of our proxy message struct to avoid ending up in the middle of a packet. While for now this may not be too tragic, since we currently only ever send a single packet and then wait for the response, we may at some point want to be able to handle multiple processes simultaneously, hence it makes sense to switch to a packet based connection. So switch to using SOCK_SEQPACKET which is packet based, (and also guarantees ordering). The `MSG_PEEK` flag can be used with `recvmsg()` to figure out a packet's size on the other end, and usually the size *should* not change after that for an existing connection from a running container. Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
The previous API doesn't reflect the fact that `seccomp_notif` and `seccomp_notif_resp` are allocatd dynamically with sizes figured out at runtime. We now query the sizes via the seccomp(2) syscall and change `struct seccomp_notify_proxy_msg` to contain the sizes instead of the data, with the data following afterwards. Additionally it did not provide a convenient way to identify the container the message originated from, for which we now include a cookie configured via `lxc.seccomp.notify.cookie`. Since we currently always send exactly one request and await the response immediately, verify the `id` in the client's response. Finally, the proxy message's "version" field is removed, and we reserve 64 bits in its place. Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
This is an arbitrary string to to be included in proxied seccomp notification messages. Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Wolfgang Bumiller authored
we want to use SOCK_SEQPACKET and in the future perhaps SOCK_DATAGRAM as well Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Wolfgang Bumiller authored
Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-
- 08 Jul, 2019 2 commits
-
-
Christian Brauner authored
pidf_send_signal: fix return value
-
Wolfgang Bumiller authored
Signed-off-by:Wolfgang Bumiller <w.bumiller@proxmox.com>
-