Article View: linux.kernel.netdev
Article #23748Re: [PATCH net-next 1/5] lisp: add LISP (Locator/ID Separation Protocol)
From: netdev-bot+sashiko
Date: Fri, 27 Nov 2026 22:25
Date: Fri, 27 Nov 2026 22:25
146 lines
12904 bytes
12904 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · 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_stop() unlinks a non-collect_md device's node from its
socket's IID hash chain with hlist_del_rcu() (lisp.c:414) and returns…
- [Low] drivers/net/lisp.c does not build or link when CONFIG_IPV6=n.
--
lisp: add LISP (Locator/ID Separation Protocol)
This adds a LISP (RFC 9300) data plane tunnel device. It encapsulates IPv4
and IPv6 packets in a LISP header over UDP port 4341. The RLOC of each
packet comes from the lightweight tunnel metadata of its route or nexthop,
and the kernel keeps no map-cache.
> diff --git a/drivers/net/lisp.c b/drivers/net/lisp.c
> new file mode 100644
> index 0000000000000..8f5a79c88b2c1
> --- /dev/null
> +++ b/drivers/net/lisp.c
> @@ -0,0 +1,1033 @@
[ ... ]
> +static int lisp_stop(struct net_device *dev)
> +{
> + struct lisp_dev *lisp = netdev_priv(dev);
> + struct lisp_sock *ls;
> + struct lisp_net *ln;
> +
> + ln = net_generic(lisp->net, lisp_net_id);
> + mutex_lock(&ln->lock);
> +
> + ls = rcu_dereference_protected(lisp->sock, lockdep_is_held(&ln->lock));
> + RCU_INIT_POINTER(lisp->sock, NULL);
> + if (lisp->collect_md)
> + RCU_INIT_POINTER(ls->md_dev, NULL);
> + else
> + hlist_del_rcu(&lisp->hlist);
[Severity: Medium]
Can this node be linked again before a grace period has passed?
hlist_del_rcu() leaves lisp->hlist.next pointing into the old chain, and
lisp_stop() returns without waiting. __dev_close_many() calls
dev_deactivate_many() before ndo_stop, so the close path does not wait
after this point either.
The next lisp_open() then does:
hlist_add_head_rcu(&lisp->hlist,
lisp_iid_head(found, lisp->iid));
That overwrites lisp->hlist.next. lisp_l3mdev() is computed again on every
open. If the link moved to another VRF while the device was up, found can
be a different lisp_sock than before.
Take a reader on the old socket A that is sitting on this node, in
lisp_udp_encap_recv()->lisp_lookup(). It would follow the new next pointer
into socket B's bucket:
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);
Every entry in B's chain fails the lisp->sock == ls test. So any device
that came after the moved node in A's bucket (same hash_32(iid, 10) value)
is skipped. Its packet is then dropped or delivered to A's collect_md
device.
The comment in lisp_lookup() covers stale matches from a device that
moved. Does it also cover valid entries being skipped like this? Memory
stays valid, since lisp_dev and lisp_sock outlive the readers.
Would hlist_del_init_rcu() followed by synchronize_net() in lisp_stop()
avoid this? Delaying the re-add until after a grace period would also
work.
> +
> + if (--ls->refcnt) {
> + mutex_unlock(&ln->lock);
> + return 0;
> + }
[ ... ]
> +static netdev_tx_t lisp_xmit(struct sk_buff *skb, struct net_device *dev)
> +{
[ ... ]
> + rcu_read_lock();
> + ls = rcu_dereference(lisp->sock);
> + if (!ls)
> + err = -ESHUTDOWN;
> + else if (ip_tunnel_info_af(info) == AF_INET)
> + err = lisp_xmit_skb(skb, dev, ls->sk4, info, iid);
> + else if (ls->sk6)
> + err = lisp6_xmit_skb(skb, dev, ls->sk6, info, iid);
[Severity: Low]
Does this link when CONFIG_IPV6=n?
The LISP Kconfig entry only has "depends on INET", so CONFIG_LISP=y or m
with CONFIG_IPV6=n is a valid config. Only the runtime test on ls->sk6
guards this call, so the compiler cannot drop it. lisp6_xmit_skb() calls
udp_tunnel6_dst_lookup() and udp_tunnel6_xmit_skb().
include/net/udp_tunnel.h declares those helpers without !IPV6 stubs. They
are defined only in net/ipv6/ip6_udp_tunnel.c, and net/ipv6/Makefile
builds that file only when CONFIG_IPV6 is set:
ifneq ($(CONFIG_IPV6),)
obj-$(CONFIG_NET_UDP_TUNNEL) += ip6_udp_tunnel.o
With CONFIG_LISP=y the link would fail. With CONFIG_LISP=m, modpost would
report the symbols as undefined. The later patches in the series do not
seem to change lisp.c or the Kconfig dependencies.
bareudp_xmit() avoids this with a guard that folds at compile time:
if (ipv6_mod_enabled() && info->mode & IP_TUNNEL_INFO_IPV6)
Could this branch test ipv6_mod_enabled() or IS_ENABLED(CONFIG_IPV6)?
Adding "depends on IPV6" to the Kconfig entry would also work.
> + else
> + err = -EAFNOSUPPORT;
> + rcu_read_unlock();
[ ... ]
--
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:
<179581834896.3135.15923750690737278293@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372959-linux-kernel-netdev=dewy.ruReferences:
<20261126-for-upstream-lisp-v1-v1-1-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!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372959-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 1/5] lisp: add LISP (Locator/ID Separation Protocol) Date: Fri, 27 Nov 2026 22:25:48 +0000 Organization: Usenet Network Message-ID: <179581834896.3135.15923750690737278293@kernel.org> References: <20261126-for-upstream-lisp-v1-v1-1-7382a4bcfd9b@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="833138"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ZCwdEDnT3BGSCAOC5hFuQvj7LZ4= sha256:5HLhFwj1IwcY/yX6bIUif8qoSPJjCq5ispJjs7+eqhg= sha1:fR2CafwURUTxtQY1HTkFWREAGDY= sha256:Cxaxrhky1ZtLNoIqtORaBDEa4XLFwe9RdFic/2wI2e8= 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 BFB65125F66; Sat, 28 Nov 2026 01:26:08 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[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 SAC0xnme08kk; Sat, 28 Nov 2026 01:26:04 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372959-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 7BEB4125F68; Sat, 28 Nov 2026 01:25:55 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id F130B295EC; Fri, 27 Nov 2026 22:25:52 +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=1795818352; b=nxddaYHryxtAvUuT/ThXAqcDSO9zCg971i4tPGQhBfw/+kKl9MbuKncWG8akG5RP09o0 zBr9bjiHeuzRlRfcyP/tBAnsWhR+W3c6Eh4+y4f5tP71FnYXZPodMpIt7UZuJv+l8visl wYApo2quimgCR3VeyXzHlFJy0sa2BnDMgE6BDF8OSWBlEQsFBhjlFb3YlV5aagKQl34Y/ dSAcHPf9+3MhcIOEUs397Q5hMy3YXOP8M2oxBEYEsg0pFl1Kk69FIW7A45hA7sczFpxWj q0uAdX38oQmbr9PSDw8dv21/fp9Yfpun2attRXTnAIkjig8MPlNvWAchUSPHeV4fX9A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795818352; 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=J3OXrB+qnfqs8J/pcjSchgPpiMrzp5iVIsEEnVjP9x0=; b=UCyx26T4M91zDgU8uNm2jzJxiUdnTx2YYic3fXoHcKiYPqXPzO1l876fCcBWRQya/Bwk GY3axKOcEIYr8cTJw9Zgs8UpEQ8R0N/3R90UKwt2dIQ7HHk91fmurx1ByjxuzrVpQNHl5 RHQYNyNn+eLGERwl7VU3nZHCDfUM+mFFF4jzSVyVP5fEYHeu5MMwaHLd8n6QeAXiyNP0Y K476sNPFe47tRDVbjyvnFiLK7IaHStpW6fN2sDILOEpaifoOkfd+7NAZ7J0efi5J2BvwX Yt/JfQLPeLs416YH1RYLtZcJXZTgAzZOXzyZp1EzEUWbdy3zoSyc+8hX/wHpTyAC0jg== 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=kvETFVJz; 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 14D94606A330; Fri, 27 Nov 2026 22:25:52 +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=kvETFVJz 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=1795818351; b=RlAWyPRWGcrpCl60shnnjI6jqf9c0XiSnB9udVpVYlasSKSBLm8A30PSvBBUSUBsdxFo sVWGkrnklNlIez5FVqKNoFPr9XfQwyfome4rZH4stFo1FpEWHvK0R00ceg0Bh6V15yxoM Saxysj5kk+OPwtGeonaOsFiS61biEkFCesvBYsSJzDPCBf0pOZDfVHXuJyuFcV3TVqo4J YoGu5BDoEWDGg3iLzJ4iDrcQJczLxIABu7JPTLsEAf0F/6ufAhb44BXFWolMMXM+j4hY6 irQCKEylWpnOGiLLfUgxi+ZJcbFZBJkJWyUMiRtuIPr4NxPOGrepaNtRUx6OSl5DBWg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795818351; 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=J3OXrB+qnfqs8J/pcjSchgPpiMrzp5iVIsEEnVjP9x0=; b=S3/cH584RgPO98Z7VKHy4vel6WCZ6yhIRqw8fApG6Xp7SSnTXSS5l53Ns+CaeM6eF28F iBJlYYEKidC6jKsVlzOeZXwtC+8Ooi4SiQI2+fDHY4B2hJg/VqCvVrwWZtQkZX/PygNfx M6k/3ysP5lieX+fmKlAbmZoaB+joL8EpkBED47m8US4iIsMzy0+G4PktgcejjvobBvfVY 0FJJmxR4MHkP6e46+GTpSX0CMVLOV4v7PmLbs9zcnee1Xf2G9UPlUEWZbJZ6HYzAIivAa m20XJI4LDY5bsFk9y/5/bZPdymUZ+nnJVMzPdc41b1OIzc2FTUlBSrBTSNovoE8lSDA== 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=kvETFVJz; 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 33605606A31C; Fri, 27 Nov 2026 22:25:50 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CCC81F00893; Fri, 27 Nov 2026 22:25:49 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795818350; bh=J3OXrB+qnfqs8J/pcjSchgPpiMrzp5iVIsEEnVjP9x0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=kvETFVJzro+dil6nqdRekj5ajUY5DqVgP+NfLdPRaeTp0gVgHF2elnzohQtxmtLuR vDNSB7mqTKmvsyxh/qG1ojIEs+GjlpgaEobqmf4Lt0cOEft1gGuOzdJSnV3kRDX1gz ilMj0dNQ5XdcyL/NYvfaWTQk2dyhKFz2Fle+DGCwOgUHgczmQ1XWktk5SNICDIj/ef WoRHQQTzxwpXlWFAVw7ent73U73bg1lJkTQyvLPRPOf7Np6yZnpHvIr7sVBnW0ABzH yVKkzHy4IZQ9mC+QDCEK6nvzM6cSQZezAq2K5zo/Jdg8NH2C9iQUMk0NH+JPm6h48P DRCrF0zvNTP/A== 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-1-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