🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23750

Re: [PATCH net-next 3/5] docs: net: document the LISP devices

#23750
From: netdev-bot+sashiko
Date: Fri, 27 Nov 2026 22:25
189 lines
14408 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] lisp.rst says the metadata-collecting device "serves all the
  instance IDs that have no device of their own" (lines 42-43), and that…
- [Medium] The 'Checking the IP sources' section of
  Documentation/networking/lisp.rst (lines 122-127) is the only source…
- [Low] The example for the metadata-collecting device in
  Documentation/networking/lisp.rst fails if you run it as written.

--

docs: net: document the LISP devices

This commit adds Documentation/networking/lisp.rst. The new file covers
the two kinds of LISP devices, how routes and nexthops give the RLOCs, and
what checks the sources of decapsulated packets. The commit also adds the
file to the networking index, MAINTAINERS and the LISP Kconfig help text.

> diff --git a/Documentation/networking/lisp.rst b/Documentation/networking/lisp.rst
> new file mode 100644
> index 0000000000000..70ad8bb29700b
> --- /dev/null
> +++ b/Documentation/networking/lisp.rst
> @@ -0,0 +1,142 @@

[ ... ]

> +Devices
> +=======
> +
> +There are two kinds of LISP devices.
> +
> +A device (1) with an instance ID sends and receives the packets of that instance::
> +
> +  ip link add site type vrf table 10
> +  ip link set site up
> +  ip link add lisp101 type lisp id 101
> +  ip link set lisp101 master site up
> +
> +It is meant to be in the VRF of the EIDs of the instance: what it receives is
> +routed in that VRF, and the routes of that VRF send to it. A site has one
> +device per instance, whatever the number of remote sites.
> +
> +A device (2) that collects metadata serves all the instance IDs that have no device
> +of their own::

[Severity: Medium]
Does the driver follow this description when an instance ID device exists
but is down?

An instance ID device is added to the receive hash only in lisp_open(),
and lisp_stop() removes it:

drivers/net/lisp.c:lisp_open() {
    ...
		hlist_add_head_rcu(&lisp->hlist,
				   lisp_iid_head(found, lisp->iid));
    ...
}

drivers/net/lisp.c:lisp_stop() {
    ...
		hlist_del_rcu(&lisp->hlist);
    ...
}

When nothing in the hash matches, lisp_lookup() falls back to the
metadata device:

drivers/net/lisp.c:lisp_lookup() {
    ...
	hlist_for_each_entry_rcu(lisp, lisp_iid_head(ls, iid), hlist)
		if (lisp->iid == iid && rcu_access_pointer(lisp->sock) == ls)
			return lisp;

	return rcu_dereference(ls->md_dev);
}

Take lisp101 (id 101) down while lisp0 external stays up on the same RLOC
sockets. Wouldn't lisp_udp_encap_recv() then decapsulate the IID 101
packets on lisp0 with tun_id 101? They would be routed in lisp0's routing
domain instead of being dropped.

lisp_newlink() does treat a down device as the owner of its IID:

drivers/net/lisp.c:lisp_newlink() {
    ...
		if (tmp->iid == lisp->iid) {
			mutex_unlock(&ln->lock);
			NL_SET_ERR_MSG(extack,
				       "A LISP device already has this instance ID for these RLOCs");
			return -EEXIST;
    ...
}

Should lisp_lookup() stop at any registered device for the IID, up or
down? If not, could the document say that only an up device takes its IID,
and that the traffic of a down instance goes to the metadata device?

> +
> +  ip link add lisp0 type lisp external
> +

[ ... ]

> +An IPv6 nexthop is used by IPv4 and IPv6 routes. With the device that
> +collects metadata, the nexthop gives the instance ID too::
> +
> +  ip -6 nexthop add id 4 encap ip id 102 dst 192.0.2.1 dev lisp0

[Severity: Low]
Will this command fail when the examples are run in order? The Devices
section creates lisp0 with ip link add lisp0 type lisp external and never
brings it up, unlike lisp101. rtm_to_nh_config() rejects a nexthop whose
device is not up:

net/ipv4/nexthop.c:rtm_to_nh_config() {
    ...
		if (!(cfg->dev->flags & IFF_UP)) {
			NL_SET_ERR_MSG(extack, "Nexthop device is not up");
			return -ENETDOWN;
		}
    ...
}

The lisp.sh selftest added later in the series runs ip link set lispmd up
before it uses its collect_md device. Could ip link set lisp0 up be added
to the lisp0 example?

[ ... ]

> +The reverse path filter of IPv4 checks the source EID. With ``rp_filter`` set
> +to 1 for the LISP device, a packet is dropped unless the route to its source
> +sends to that device, that is, unless its source has a mapping in that
> +instance. The packets that it drops are counted as ``IPReversePathFilter``::
> +
> +  sysctl -w net.ipv4.conf.lisp101.rp_filter=1

[Severity: Medium]
Is the per-device setting enough to get the strict check described here?
The kernel uses the larger of the all value and the per-device value:

include/linux/inetdevice.h:
#define IN_DEV_RPFILTER(in_dev)		IN_DEV_MAXCONF((in_dev), RP_FILTER)

Documentation/networking/ip-sysctl.rst says the same: "The max value from
conf/{all,interface}/rp_filter is used".

Some distributions set net.ipv4.conf.all.rp_filter=2 by default. With that
setting the LISP device runs in loose mode. fib_validate_source() then
accepts a decapsulated packet if its inner source has any unicast route,
such as a default route in the VRF, even one that does not go through the
LISP device.

The device accepts UDP/4341 from any outer source for a matching IID. A
spoofed inner EID would then get into the VRF of the instance.

IPv6 EIDs on an instance ID device also get no built-in source check.
rp_filter only applies to IPv4, and lisp_udp_encap_recv() attaches the
outer RLOC as tunnel metadata only for collect_md devices:

drivers/net/lisp.c:lisp_udp_encap_recv() {
    ...
	if (lisp->collect_md) {
		IP_TUNNEL_DECLARE_FLAGS(flags) = { };

		__set_bit(IP_TUNNEL_KEY_BIT, flags);
		tun_dst = udp_tun_rx_dst(skb, family, flags,
    ...
}

So a tc enc_src_ip filter cannot be used on such a device.

Could this section state the max(all, dev) rule, or tell admins to set
conf.all.rp_filter to 0 or 1? Could it also point IPv6 users to the
netfilter rpfilter or fib match?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126-for-upstream-lisp-v1-v1-0-7382a4bcfd9b%40free.fr
Technical Details
Message-ID: <179581835102.3135.8668737900789396018@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372960-linux-kernel-netdev=dewy.ru
References: <20261126-for-upstream-lisp-v1-v1-3-7382a4bcfd9b@free.fr>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372960-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 3/5] docs: net: document the LISP devices
Date: Fri, 27 Nov 2026 22:25:51 +0000
Organization: Usenet Network
Message-ID: <179581835102.3135.8668737900789396018@kernel.org>
References: <20261126-for-upstream-lisp-v1-v1-3-7382a4bcfd9b@free.fr>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="833241"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:HOuyeyG1halcSXq5iibeHmpVJmg= sha256:llstWRCJ5wQ1zce3ja9Qs9R9wUXbXrw69UbUfH8VylY= sha1:ylWSzkK6ApwVPAvXTicosqIpU8E= sha256:4YeK7KZyLlMfWG7DFp0cRqOIV/Sj/S9jaiAfm5xNGbE=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 59BE9125F68; Sat, 28 Nov 2026 01:26:12 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id McQFGtU7KF0e; Sat, 28 Nov 2026 01:26:09 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372960-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id A5E8D125DC5; Sat, 28 Nov 2026 01:25:59 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 8DA5D2D7E6; Fri, 27 Nov 2026 22:25:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795818353; b=ptX504rwPRQlx9Y1Bzr9jq1dAAC/NPsu08d3Z60doA1VM0GP3UZGdFOQzjb3w9li0qKR LMZ4pyo9CaA556QFdZ64KSOuMc4V6nmTu3cdCzljuBQ8y6J3DAtr/jiAkKkx/Wor6qvBw 73jq1/zYqP7cpGtdXJ2Cj21OR6xSYQYs/Tq/kqK9ETapI1C5t3EQRGFyL7VEPtn74TWF/ us809urHnqpf+NbRSUEmV7gkL5pysjdLLLIXq8SzL8Mj884lj+6JXJQGX8soymiqusgAd GZNyQtpLJ7JoOj+SXY348lLbusOulJFId/kRXl+7GfeoXYJD71r8r/rJhw3gXADUE4g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795818353; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=a407YldGuJWXNb9YTA7Ms1UcaHO3fsUXFP5hDpnsY/Y=; b=J7ASmJxmddtb+u3RqWZV1BcR3jFMb8LQiuOS/68hI72NDtgZdMDEntDDtJF9aEagfkn4 3zJPNAxc6xsDQ/Kx2whIH9IXFvSSBNZfSNd0iIHsbRkSXcyRBKxbp7FiS3Hgioi7qtesW eoDI7/HMsqDiMJ+XiTS7Q7/Cr0GLvVYkNJwOr9ecPSBYnCJpV+I4OaYTgWh3ZvCTc3QS/ 7wXZ7PtEzUohfeRj+E0lFvuv/nvRtQoweZ0sGt2DHOHrV1FwKTAXq4Lrq1vs2Lfu+riOZ qHADj3jygWDnt0is3QOGjdf/uleSmK4CHMj0ikBaV41Vx3Zm0XsFmA1lxH6rGhWeglQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nnd86l91; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 971F4606A32E; Fri, 27 Nov 2026 22:25:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nnd86l91
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795818352; b=5iF7g2Zos/eIGnakaJ4JaaAp0uOb8z3R+T3lQ3MmrU/CCLIR9rSHAPLhWRh3k7bOJ7cN Taxk4Bxz9VuJg4OEvMSVuqHjYaH0Shsf41wjLCSNonB2WGBsQQ3CP8CXNi96jXE82sP1l q4oTPMLrLhxI5S4zd5AEUJ5XMXruX4eM37avd5BUpO0sn0AqBtiBr6N3qEE/sEK9GEi4J Nnmubojl5zHn58sYAB43Amyc/VSArOrQTEygu4HArLTRfq/R+y9MuYz9frGzNpxDgT4tt coE8cMApdhWu4uB1WXLQP7BxWHY/CPbwf51myAPYCOkorZNRhsVzKnpVgZNSZsRDurQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795818352; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=a407YldGuJWXNb9YTA7Ms1UcaHO3fsUXFP5hDpnsY/Y=; b=k233Fd9LXNXGJkDtLNRGNdi3gf35tDfkRTZqjbqqi3FM6Qs5l67GJSzJWy1eZOnHEEV9 2jyH4Zpn09rp1T3876gLShgdwmVljXBhawUNWSvUUykxuRXzesweZixe1o7ABiqVxeGDH /f+6eIZDZVe/8+vFbtEVg1aNC7FkOWCOqAAeEARjxMVkOO3oTtG6x0H8l1uPb0vhidFDj M0WqtaBCao/oPsRrnJwL0CtOLzhTg1lK9gqKgW5Ud47AegZUh0ktIm3AX165JdhLhYgGv ktCFa/O+vBGoipqoN3BAriLcbSVatdqm7oOaGYRciCZxi/m2Els6p19bYEu+0KefdYA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nnd86l91; arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8929606A336; Fri, 27 Nov 2026 22:25:52 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A0561F00893; Fri, 27 Nov 2026 22:25:51 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795818352; bh=a407YldGuJWXNb9YTA7Ms1UcaHO3fsUXFP5hDpnsY/Y=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=nnd86l91UrVI7p/ywPaPNuin652GI835IX+s5tXGMVhiScfOYMuvrR33mvvlFo0Iu M/kgjMxeXZZZaXb9Xsizm7GBhu9fCbhZk+yZzCPnb73S8MhLj8Mn3E37e3SeR0sTMM 1TlSxLfXnoBdJXZzaf0tvopH+OT4+Jei98WN857hz8wmpo2BZD/Aiww0J6Roci5Eyy 68un2ycx/xGpWFJhVb3zw7QEeq3/9CM9dmKohITCVm3e0dIVdzo1VD8zJEo1qD2NbD DETjPFtLEIyHf4BSQwqCj3agh3cmUoFtgKjPMmF1k5mRPTp2gIll7WcfFQ8pwhy4m2 eLkT3L7rH2Utg==
X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, donald.hunter@gmail.com, nicolas.dichtel@6wind.com, horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, shuah@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org
X-In-Reply-To: <20261126-for-upstream-lisp-v1-v1-3-7382a4bcfd9b@free.fr>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list