From c9b24134656925e53fea3cde0b33ab143dcd84af Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 22 May 2024 20:18:19 +0200 Subject: conf, passt, tap: Open socket and PID files before switching UID/GID Otherwise, if the user runs us as root, and gives us paths that are only accessible by root, we'll fail to open them, which might in turn encourage users to change permissions or ownerships: definitely a bad idea in terms of security. Reported-by: Minxi Hou Reported-by: Richard W.M. Jones Signed-off-by: Stefano Brivio Acked-by: Richard W.M. Jones --- tap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tap.h') diff --git a/tap.h b/tap.h index d146d2f..2285a87 100644 --- a/tap.h +++ b/tap.h @@ -68,6 +68,7 @@ void tap_handler_pasta(struct ctx *c, uint32_t events, const struct timespec *now); void tap_handler_passt(struct ctx *c, uint32_t events, const struct timespec *now); +int tap_sock_unix_open(char *sock_path); void tap_sock_init(struct ctx *c); #endif /* TAP_H */ -- cgit v1.2.3