Linux Documentation
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: vjardin@free.fr
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
Subject: Re: [PATCH net-next 3/5] docs: net: document the LISP devices
Date: Fri, 27 Nov 2026 22:25:51 +0000	[thread overview]
Message-ID: <179581835102.3135.8668737900789396018@kernel.org> (raw)
In-Reply-To: <20261126-for-upstream-lisp-v1-v1-3-7382a4bcfd9b@free.fr>

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

  reply	other threads:[~2026-11-27 22:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 21:37 [PATCH net-next 0/5] lisp: add a LISP (RFC 9300) tunnel device Vincent Jardin via B4 Relay
2026-11-26 21:37 ` [PATCH net-next 1/5] lisp: add LISP (Locator/ID Separation Protocol) Vincent Jardin via B4 Relay
2026-11-27 22:25   ` netdev-bot+sashiko
2026-11-26 21:37 ` [PATCH net-next 2/5] netlink: specs: rt-link: add the lisp link type Vincent Jardin via B4 Relay
2026-11-26 21:37 ` [PATCH net-next 3/5] docs: net: document the LISP devices Vincent Jardin via B4 Relay
2026-11-27 22:25   ` netdev-bot+sashiko [this message]
2026-11-26 21:37 ` [PATCH net-next 4/5] selftests: net: add a test of " Vincent Jardin via B4 Relay
2026-11-27 22:25   ` netdev-bot+sashiko
2026-11-26 21:37 ` [PATCH net-next 5/5] selftests: net: add a scale test for LISP Vincent Jardin via B4 Relay
2026-11-27 22:25   ` netdev-bot+sashiko
2026-11-27 10:24 ` [PATCH net-next 0/5] lisp: add a LISP (RFC 9300) tunnel device Matthieu Baerts
2026-11-27 22:47   ` Vincent Jardin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179581835102.3135.8668737900789396018@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=vjardin@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox