| /* SPDX-License-Identifier: GPL-2.0-only */ | |
| // Copyright (c) 2026 Jarkko Sakkinen | |
| #ifndef UCELLS_SANDBOX_H | |
| #define UCELLS_SANDBOX_H | |
| #include <linux/filter.h> | |
| #include <stdbool.h> | |
| #include <stdint.h> | |
| struct cell_sandbox { | |
| struct sock_fprog prog; | |
| uint64_t caps; | |
| }; | |
| int cell_sandbox_compile(uint64_t caps, uint64_t net_rights, bool no_net, | |
| struct cell_sandbox *out); | |
| void cell_sandbox_destroy(struct cell_sandbox *sandbox); | |
| int cell_sandbox_apply(const struct cell_sandbox *sandbox, | |
| uint32_t effective_uid); | |
| int landlock_prepare(void); | |
| void landlock_restrict(int fd); | |
| #endif |