From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 71E063D16F9 for ; Thu, 21 May 2026 12:36:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779366978; cv=none; b=Z4D8Wf2LmzhoUoTgEsEZGArxie+DQZcIhBMcfhli5ik79wDS3o6/xHrkq+4vH4Qb7WLCxChf1EMRzcJQkd86JRoQk1oCvUvL2Vw/S/z4J4qLG3D0cClp4CNk2/LLKDX3byPzTPhG6/VSUWyQMgUN0uHHOkz9Co9fpTjy/KWlhpY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779366978; c=relaxed/simple; bh=uJWKKIto+eGw/Y8Qn5mFfXiI77w3A5Y0n2+GfY+7Hqc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bDh7iliKnUXJvP12F01GseG+uLty15hLqW82Jvjk5sU75G483X+MctvzMnxhZUKIaPNImB7ZtkyRgsy0+z2SjJ8bOyit7picC8GNiwMzLCdPbYvDGeJiL5oFVWrrxnq70CpmK5PeoIXuRwAtoaPFv26z5fuL9LWgr3Lu1It/Rzc= 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=jQCIrRZT; arc=none smtp.client-ip=209.85.221.46 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="jQCIrRZT" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-449cdc12a8aso800163f8f.2 for ; Thu, 21 May 2026 05:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1779366974; x=1779971774; 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=Zv2DG/vKNY6iKYozQd3io+YpWsjZ5YJkp1OxFatMD2k=; b=jQCIrRZTj3wRW6h99g1cn7bcyknT1ssz7HYrTBSWeUWz8OvvcJ9/aS6UTK+AmWuyqn Vh27ONrv5e1UGLLf4Q/4eOSEwiT3s2D5Z2CBNuewuzTZHdEq6hNjJmbJrcxYbKUvLW4n fv63NCc8M03Uw3rJe4kovKQntc7QhH6NaudqPdrxexC2w1C//tdlJheKHlkKLUPVlPMZ /6Wy6nfuNbCUtxyF88ZKhFkF8awq4wSQI8rnromxSxNPEBeqBr0lWaRWyRP3ytT4urEN +SvAhS5svebrVjCJVs1OQPO1ODPmxDNlkiKwnR/qD0PvoSgncr8PwxZvsgm0pOkior4j DoLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779366974; x=1779971774; 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=Zv2DG/vKNY6iKYozQd3io+YpWsjZ5YJkp1OxFatMD2k=; b=rl5MxRPm3tNxpDDOQ/pmUERibiZsijaYbAqGIs7k+3ekoqFPUuq0cdNZJiMknhyoIx shDgjJeuoCEzab9Zmk8dPbjrr3zHpkE0BIsnK1aDPoc8aU0NedHp5wIrMW6oMHYyiONo KDBqbTQaw2y+T0JGGA1OZSMk2o7yDwO0BM8ooXpRLPeFdLceAtdF/UC9gsWM3fm56JHw /q8xbrwQnEYD7igrZbBGWQzRJ5meGmMGHBaBWuWzOqO4IZY0nNVnicWvoddUaEcuxltJ VcsBBP4ZUVRZfwiFgw+XRQwY7HTAKc9QXqzb/0on9VKG2ZCiDAkP3M0kWTBPXumZvcFb GA6Q== X-Forwarded-Encrypted: i=1; AFNElJ+JsGT7zD79JrEQB9n1VvhVuxTnGuC3BFpCUD0I4+Gg039faHqmqsbzIgp5DMirYZREal/WqrUHfrHEOxA=@vger.kernel.org X-Gm-Message-State: AOJu0YzszqbLzA4euzVUZRTZQo4IkrR8GUtHiW4Wc+H0DAw8deoyRZJB zWXnMw7VH3XnincqTB/66f4eBBAcEyuldMIF0f+hBQEdkLXYMcqk1vfa+SD4YiMcD7Y= X-Gm-Gg: Acq92OEyen4cJgbjE5i2EGXjhA/BfZt3z5ZhsP7Or9oc4JqhFSzSOzV8XV36RgLP7bd 6cX9yPYa7uHXoz5kWXFyf1l8v8HXOehpjLCkjZvXZXgDeMqTInsnr8CrDDgg7zZT/Cea7Rt6az4 5oAvsYcQDKgcZoL6wV09MRAfTP5LI9ZucB89kHwfBxoIhnutlUCNbMb+XUJMpq4E4mMs6JVSPET D8PHCxW+aUsufYwyREp+kxKoo9cwy0MQFjkWXjiREO6Nme+o32yIfv4FcVYBL6nM29emdt7OL1s I4i7AoEDB8ewpmOiVzh2LsZrRrjOl0dir75gdW+dDLyngpGnka0eqU5ocNhQWXzfei4sUFzNwml 9IxZ9R7PTrJsbrsHgzbaYC3R8lv10AfpxK77ATOy6sdDw7nfHChzmbRuwKHbtIHpv86r4k5LjVV KVmIDu9pbL5E9eugCStmtrk3jPYOu3mYnvep3cDXnLz/Ib0bI+qGJiim+L7rqbIlmUOedZUGpOd Wwi X-Received: by 2002:a05:6000:389:b0:451:b39:a206 with SMTP id ffacd0b85a97d-45ea3cef56dmr1551400f8f.6.1779366974045; Thu, 21 May 2026 05:36:14 -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 ffacd0b85a97d-45eaa937e69sm2356434f8f.32.2026.05.21.05.36.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2026 05:36:13 -0700 (PDT) Message-ID: Date: Thu, 21 May 2026 14:36:12 +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 v2 2/4] net: netlink: don't set nsid on local notifications To: Ilya Maximets , netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Donald Hunter , Shuah Khan , Kuniyuki Iwashima , Kees Cook , Adrian Moreno , Jiri Benc , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Matteo Perin References: <20260520172317.175168-1-i.maximets@ovn.org> <20260520172317.175168-3-i.maximets@ovn.org> From: Nicolas Dichtel Content-Language: en-US Organization: 6WIND In-Reply-To: <20260520172317.175168-3-i.maximets@ovn.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le 20/05/2026 à 19:22, Ilya Maximets a écrit : > In most cases, notifications on sockets with NETLINK_LISTEN_ALL_NSID > do not contain NSID in their ancillary data in case the event is local > to the listener. > > However, when a self-referential NSID is allocated for a namespace, > every local notification starts sending this ID to the user space. > > This is problematic, because the listener cannot tell if those > notifications are local or not anymore without making extra requests > to figure out if the provided NSID is local or not. The listener > can also not figure out the local NSID beforehand as it can be > allocated at any point in time by other processes, changing the > structure of the future notifications for everyone. I don't understand the use of NETLINK_LISTEN_ALL_NSID without being able to associate an nsid with a netns. > > The value is practically not useful, since it's the namespace's own > ID that the application has to obtain from other sources in order to > figure out if it's the same or not. So, for the application it's > just an extra busy work with no benefits. Moreover, applications > that do not know about this quirk may be mishandling notifications > with NSID set as notifications from remote namespaces. This is the > case for ovs-vswitchd and the iproute2's 'ip monitor' that stops > printing 'current' and starts printing the nsid number mid-session. Why does ovs-vswitchd use NETLINK_LISTEN_ALL_NSID if it isn't able to do the nsis <-> netns association? How are used nl msg with an nsid? > > Lack of clear documentation for this behavior is also not helping. > > A search though open-source projects doesn't reveal any projects > that use NETNSA_NSID_NOT_ASSIGNED and rely on metadata to contain > self-referential NSIDs (expected, since the value is not useful). > Quite the opposite, as already mentioned, there are few applications > that rely on NSID to not be present in local events. > > Since the value is not useful and actively harmful in some cases, > let's not report it for local events, making the notifications more > consistent. I still don't think that this is the right "fix". The app is broken. Even after this patch, the bug could be easily triggered again by a third party. There is nothing wrong with assigning a self-nsid. It would be a lot more robust for the app to assign itself a self-nsid when it starts. Regards, Nicolas