From 6909a8e3390913d656f55803fa6cf5d0b1d46812 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 14 Oct 2022 15:25:30 +1100 Subject: Remove unhelpful drop_caps() call in pasta_start_ns() drop_caps() has a number of bugs which mean it doesn't do what you'd expect. However, even if we fixed those, the call in pasta_start_ns() doesn't do anything useful: * In the common case, we're UID 0 at this point. In this case drop_caps() doesn't accomplish anything, because even with capabilities dropped, we are still privileged. * When attaching to an existing namespace with --userns or --netns-only we might not be UID 0. In this case it's too early to drop all capabilities: we need at least CAP_NET_ADMIN to configure the tap device in the namespace. Remove this call - we will still drop capabilities a little later in sandbox(). Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- pasta.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'pasta.c') diff --git a/pasta.c b/pasta.c index cbe0b3a..a6e49eb 100644 --- a/pasta.c +++ b/pasta.c @@ -224,8 +224,6 @@ void pasta_start_ns(struct ctx *c, int argc, char *argv[]) exit(EXIT_FAILURE); } - drop_caps(); - NS_CALL(pasta_wait_for_ns, c); } -- cgit v1.2.3