From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2018E343880; Wed, 20 May 2026 18:32:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779301923; cv=none; b=eu2x6/9cLzE2Fwgq5NimZpDj7m64YaM+IVTfAIlS4u6CmXAPuFgzOkfm83xzfwQnzfcgg3j+/2rrz5HNHvQxgtRpYWoa2gNAWaRRCXN18sm1i/G9RVnHhM1TKmDWEqxqhdZRQuPmdfiRnKwIxcN1O8mRxhQ/6+Vu3IolvtGC1ZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779301923; c=relaxed/simple; bh=fEl2Mw/aYRGDtY4MC2c7qMYLe0HaGwxRW2zLzepYbeQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=asiNKZY41XiBot8OueBQa962N1BJX4lIl7VoJVV8Yaip3CDo7amEEtUpMj4xIubOcf1B0GK1zu4OumF8X6jztomDYFcnCNun0OdEAPWdpYTEytdGmxjbY+YyduJu+X9tOi5dsBUIRfP9QNYg2fNs/9wHm1hNGnzKthN31lbXLN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Q6iw5Oxx; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Q6iw5Oxx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 854801F000E9; Wed, 20 May 2026 18:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779301922; bh=tUrPxu8ki9HQCWUWssmDObgkGadb+xush0ByGm8zKH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Q6iw5Oxxwjtc/ITd5ay9Hl+40yBKJD6GTfb0qDnzCSpNXxKtXm4CYMkwHzOD0pCWI ivmqxsiWpaxVsC8+fxsbCbyQUJqmRAmgFgAc4m2HcXk1qoJJ0WPcFuIVaX07XS5JaW gHsGSQpQOTfuCz/xA2xs/1uykba+0yJuhoDCuWvY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Taegu Ha , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 070/508] ppp: require CAP_NET_ADMIN in target netns for unattached ioctls Date: Wed, 20 May 2026 18:18:13 +0200 Message-ID: <20260520162100.124286830@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162058.573354582@linuxfoundation.org> References: <20260520162058.573354582@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Taegu Ha [ Upstream commit 2bb6379416fd19f44c3423a00bfd8626259f6067 ] /dev/ppp open is currently authorized against file->f_cred->user_ns, while unattached administrative ioctls operate on current->nsproxy->net_ns. As a result, a local unprivileged user can create a new user namespace with CLONE_NEWUSER, gain CAP_NET_ADMIN only in that new user namespace, and still issue PPPIOCNEWUNIT, PPPIOCATTACH, or PPPIOCATTCHAN against an inherited network namespace. Require CAP_NET_ADMIN in the user namespace that owns the target network namespace before handling unattached PPP administrative ioctls. This preserves normal pppd operation in the network namespace it is actually privileged in, while rejecting the userns-only inherited-netns case. Fixes: 273ec51dd7ce ("net: ppp_generic - introduce net-namespace functionality v2") Signed-off-by: Taegu Ha Link: https://patch.msgid.link/20260409071117.4354-1-hataegu0826@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ppp/ppp_generic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 46ac51217114b..7c863cb99383b 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c @@ -1062,6 +1062,9 @@ static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf, struct ppp_net *pn; int __user *p = (int __user *)arg; + if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) + return -EPERM; + switch (cmd) { case PPPIOCNEWUNIT: /* Create a new ppp unit */ -- 2.53.0