From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFE1D357CEA for ; Thu, 18 Jun 2026 08:25:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781771155; cv=none; b=sGB3wEwVix0hSnZDmNExelOqIm+KkHwNCWALOVXdDTWRrzvb20DEGIU2TOVEYGiX24YW8/9xd0dGatyYkNK4NhqH5KPK92Q6RBkKVMr3S9xKP9+/rAVZ/ceHgNhfH2p/rASb3M5Aq8q2xJRySad9mMAWEO/SH+K7EJ9uQhEXkYs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781771155; c=relaxed/simple; bh=wdR1rT3MAyiu3Ea1dt4T0QwSz8nrbGqxl69q9c/1IZY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ppC/8YbShjgpRo/u9w328CW8QkOoBF8gSI/yVEzQgjlou0yMZD+tay5IbEj0FtI2OvIn3ZVDlW4oasR1xTRMQjLAMN0AQ8XFgK0JcMlLcjLvX6ALaLZar33YjhQfw1sVHD5eFT4EuwIzhoMAJGFqcZT6EZ6euV+40jsRc+J5dIg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=6wind.com; spf=pass smtp.mailfrom=6wind.com; dkim=pass (2048-bit key) header.d=6wind.com header.i=@6wind.com header.b=Aptl3T9b; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=6wind.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=6wind.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=6wind.com header.i=@6wind.com header.b="Aptl3T9b" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-490c737bcafso648195e9.3 for ; Thu, 18 Jun 2026 01:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1781771152; x=1782375952; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:content-language :from:references:cc:to:subject:reply-to:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=OWAZjUn2QY8Ah9cygHd5UGQrkIY9ghZ+KP/7AwdG/lU=; b=Aptl3T9bTFoOuu83CfuTSnmeOPXffRrcGWQMEQQ1Yz6fqi9Rp5H/ovYsK/jvl+shEB nMVF11BD1oQMUG2OW/OBkS1NiTcOLuX4XuIi4ZkXnvMzOUfSZ5J1/A4n1VZp1C7UavMG H6zlmMxlWjwWJDZt6OouqYp+DghIH4RrHgrT63p3RorA6K0TPX9bw17T/KcDG599NVs3 eD+KZfHXQ4FtF5ml9FaR7BbywPWesoa9juoEF+PTZIUZoEsWJYGHK/c2dzsnJpnUOdBC S+CgYYqlDAxdpOzFyarpuuXx1nnG/IidkWMQqAQ1jIULKbxmRDTKNmEUdl7fyH8lgdGS n0GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781771152; x=1782375952; h=content-transfer-encoding:in-reply-to:organization:content-language :from:references:cc:to:subject:reply-to:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OWAZjUn2QY8Ah9cygHd5UGQrkIY9ghZ+KP/7AwdG/lU=; b=pt/1ZrWwxa97Nok+Z2TuHftlT0YX5ba38XiQy0IZnyZiYHVH2+v/JQ4WUZ0RpOUeDc thpZ07VJ5SnDoS3eGStUmysUIYjHQE9tqjH1KAQYNIZxSye9/LqqWW98UQ0g/DQvfBse LQ5HkmDEdCs8pSBIuiHm7QP2iTPHKFsLTS8GfY5b0t35tuaWugVvA1nrEL48w1R6OrCq lCaEnWyEWBWnXXVUctJVeVi6Z1tzJ2p/hv52ebR2uXYuGQejlMXrjDgHyWOLAX5EVZ5u 85a+//IU26uPg0kT9+AruO6sALjXa6q8xO0g7WPd2TFFT6juqxAnrhHSzM7GkqAmo9vZ 5wdw== X-Forwarded-Encrypted: i=1; AFNElJ+cn7NjIWoBXOQWPxE9YTItgQFlRNWptTv8qnCAUvmPsb2o8wzpewrJi3SpMdZ8G5Ci0FADfCB11aM3siQ=@vger.kernel.org X-Gm-Message-State: AOJu0YydH+tM5DWTS0P4wxnVrAjN6pRFwL/4nWJ4oe3f221C5m+dtEa+ caANjpZZtOerNvT9fjZ2FMRKz9PsfAOaiCWf0G83ngLdXQu65yEIiUwxm58S0RKaXFiOEaRjaUL 0uFMKBjA= X-Gm-Gg: Acq92OF8qtrMVSISRdGwhpXP5Z5MxngpotnKaQ79hXnFNarSkPD4vXzpr6aj2oiY6Kc q58+/npBcbsMYdN7oAOHqMzJGW4VqS8Z6P34d6U1hWCycGhCMkr4G5TxAtiP77QnTJbtju9k/kv ZIkknMlJaKtqwmMYrZNbdLKLfQhMASjmFAAub+smdAIrAcAT8tYWj0qN9WKrQpMbkh9Ljgi9S/F AV7D30usAjRzxZLUetMpWWQsGkJhL0jNVUKRV6bBPSyIQ0SHljsh4JSmjzbG11zIiUbcIdljJeZ 3ViFLaZZ+EEvGEry0cGKC/Nq+n50hIcGNvvR8em2XGSfdUCZEaEhTZSjac46bvYrZYPPW7cQQIi MnTw72+27D4h79JKuYZeERiamWPEDlUAz3HKcftEvOFBVlMezDYGxZ/ckaE/BKyRbFjaIqrgF1H c2eTq3Ep1tB6MxlK44vLLaiSe7iqeIWYODGWzoigVmapns+21+vVQNp28N64CaDs0Kpg== X-Received: by 2002:a05:600c:4fd4:b0:490:e190:38f8 with SMTP id 5b1f17b1804b1-49238261a6fmr19061935e9.5.1781771152048; Thu, 18 Jun 2026 01:25:52 -0700 (PDT) Received: from ?IPV6:2a01:e0a:ab7:2110:6a1d:efff:fe52:1959? ([2a01:e0a:ab7:2110:6a1d:efff:fe52:1959]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4922f9cd140sm210641635e9.0.2026.06.18.01.25.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jun 2026 01:25:51 -0700 (PDT) Message-ID: Date: Thu, 18 Jun 2026 10:25:50 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: nicolas.dichtel@6wind.com Subject: Re: [PATCH net] net: sit: require CAP_NET_ADMIN in the device netns for changelink To: Maoyi Xie , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , Kuniyuki Iwashima , Xiao Liang , Kees Cook , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260618070817.3378283-1-maoyixie.tju@gmail.com> From: Nicolas Dichtel Content-Language: en-US Organization: 6WIND In-Reply-To: <20260618070817.3378283-1-maoyixie.tju@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le 18/06/2026 à 09:08, Maoyi Xie a écrit : > ipip6_changelink() operates on at most two netns, dev_net(dev) and the > tunnel link netns t->net. They differ once the device is created in or > moved to a netns other than the one the request runs in. The rtnl > changelink path checks CAP_NET_ADMIN only against dev_net(dev), so a > caller privileged there but not in t->net can rewrite a tunnel that > lives in t->net. > > Gate ipip6_changelink() on rtnl_dev_link_net_capable() at its top, > before any attribute is parsed. sit was the one tunnel type not covered > by the recent series that added this check to the other changelink() > handlers. > > Fixes: 5e6700b3bf98 ("sit: add support of x-netns") > Link: https://lore.kernel.org/netdev/20260612085941.3158249-1-maoyixie.tju@gmail.com/ > Cc: stable@vger.kernel.org > Signed-off-by: Maoyi Xie Reviewed-by: Nicolas Dichtel