From 32d07f5e59f2372939a7c99c4c4bcbb5f60b0e05 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 14 Oct 2021 01:21:29 +0200 Subject: passt, pasta: Completely avoid dynamic memory allocation Replace libc functions that might dynamically allocate memory with own implementations or wrappers. Drop brk(2) from list of allowed syscalls in seccomp profile. Signed-off-by: Stefano Brivio --- util.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'util.h') diff --git a/util.h b/util.h index 605b708..9edf041 100644 --- a/util.h +++ b/util.h @@ -133,6 +133,7 @@ enum { #include #include #include +#include enum bind_type { BIND_ANY = 0, @@ -143,6 +144,9 @@ enum bind_type { struct ctx; +void __openlog(const char *ident, int option, int facility); +void __vsyslog(int pri, const char *fmt, va_list ap); +void __setlogmask(int mask); char *ipv6_l4hdr(struct ipv6hdr *ip6h, uint8_t *proto); int sock_l4(struct ctx *c, int af, uint8_t proto, uint16_t port, enum bind_type bind_addr, uint32_t data); @@ -151,5 +155,6 @@ int timespec_diff_ms(struct timespec *a, struct timespec *b); void bitmap_set(uint8_t *map, int bit); void bitmap_clear(uint8_t *map, int bit); int bitmap_isset(uint8_t *map, int bit); +char *line_read(char *buf, size_t len, int fd); void procfs_scan_listen(char *name, uint8_t *map, uint8_t *exclude); int ns_enter(struct ctx *c); -- cgit v1.2.3