Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH net v2 1/1] net: l2tp: do not propagate multicast notification errors
       [not found] <cover.1787247008.git.zihanx@nebusec.ai>
@ 2026-08-20 18:40 ` Zihan Xi
  2026-08-24 11:21   ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Zihan Xi @ 2026-08-20 18:40 UTC (permalink / raw)
  To: netdev; +Cc: davem, edumazet, kuba, pabeni, horms, Zihan Xi, stable, Vega

The tunnel create, tunnel modify, session create, and session modify
netlink handlers send multicast notifications through helpers that can fail
while allocating or encoding a message, or while multicasting it.

For tunnel and session create/modify, a notification is sent after the live
operation has completed. Returning a best-effort notification error as the
command result can therefore report failure for an operation that already
committed and can cause callers to retry and accumulate live objects.

Keep sending notifications for listener visibility, but do not propagate
their best-effort status as the command result. This also keeps the tunnel
modify command consistent with the other notification-only paths.

Fixes: 33f72e6f0c67 ("l2tp : multicast notification to the registered listeners")
Cc: stable@vger.kernel.org
Reported-by: Vega <vega@nebusec.ai>
Assisted-by: Codex:gpt-5.4
Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
---
changes in v2:
  - Extend best-effort notification handling to tunnel_modify.
  - Follow the existing bare-call style instead of explicit (void) casts.
  - Document the observed ENOBUFS and committed-state reproduction.
  - v1 Link: https://lore.kernel.org/all/cover.1786962220.git.zihanx@nebusec.ai/
 net/l2tp/l2tp_netlink.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index 59457c0c1..fbdd3d055 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -248,8 +248,8 @@ static int l2tp_nl_cmd_tunnel_create(struct sk_buff *skb, struct genl_info *info
 		kfree(tunnel);
 		goto out;
 	}
-	ret = l2tp_tunnel_notify(&l2tp_nl_family, info, tunnel,
-				 L2TP_CMD_TUNNEL_CREATE);
+	l2tp_tunnel_notify(&l2tp_nl_family, info, tunnel,
+			   L2TP_CMD_TUNNEL_CREATE);
 	l2tp_tunnel_put(tunnel);
 
 out:
@@ -305,8 +305,8 @@ static int l2tp_nl_cmd_tunnel_modify(struct sk_buff *skb, struct genl_info *info
 		goto out;
 	}
 
-	ret = l2tp_tunnel_notify(&l2tp_nl_family, info,
-				 tunnel, L2TP_CMD_TUNNEL_MODIFY);
+	l2tp_tunnel_notify(&l2tp_nl_family, info,
+			   tunnel, L2TP_CMD_TUNNEL_MODIFY);
 
 	l2tp_tunnel_put(tunnel);
 
@@ -645,8 +645,8 @@ static int l2tp_nl_cmd_session_create(struct sk_buff *skb, struct genl_info *inf
 		session = l2tp_session_get(net, tunnel->sock, tunnel->version,
 					   tunnel_id, session_id);
 		if (session) {
-			ret = l2tp_session_notify(&l2tp_nl_family, info, session,
-						  L2TP_CMD_SESSION_CREATE);
+			l2tp_session_notify(&l2tp_nl_family, info, session,
+					    L2TP_CMD_SESSION_CREATE);
 			l2tp_session_put(session);
 		}
 	}
@@ -710,8 +710,8 @@ static int l2tp_nl_cmd_session_modify(struct sk_buff *skb, struct genl_info *inf
 	if (info->attrs[L2TP_ATTR_RECV_TIMEOUT])
 		session->reorder_timeout = nla_get_msecs(info->attrs[L2TP_ATTR_RECV_TIMEOUT]);
 
-	ret = l2tp_session_notify(&l2tp_nl_family, info,
-				  session, L2TP_CMD_SESSION_MODIFY);
+	l2tp_session_notify(&l2tp_nl_family, info,
+			    session, L2TP_CMD_SESSION_MODIFY);
 
 	l2tp_session_put(session);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net v2 1/1] net: l2tp: do not propagate multicast notification errors
  2026-08-20 18:40 ` [PATCH net v2 1/1] net: l2tp: do not propagate multicast notification errors Zihan Xi
@ 2026-08-24 11:21   ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2026-08-24 11:21 UTC (permalink / raw)
  To: Zihan Xi; +Cc: netdev, davem, edumazet, kuba, pabeni, stable, Vega

On Thu, Aug 20, 2026 at 06:40:28PM +0000, Zihan Xi wrote:
> The tunnel create, tunnel modify, session create, and session modify
> netlink handlers send multicast notifications through helpers that can fail
> while allocating or encoding a message, or while multicasting it.
> 
> For tunnel and session create/modify, a notification is sent after the live
> operation has completed. Returning a best-effort notification error as the
> command result can therefore report failure for an operation that already
> committed and can cause callers to retry and accumulate live objects.
> 
> Keep sending notifications for listener visibility, but do not propagate
> their best-effort status as the command result. This also keeps the tunnel
> modify command consistent with the other notification-only paths.
> 
> Fixes: 33f72e6f0c67 ("l2tp : multicast notification to the registered listeners")
> Cc: stable@vger.kernel.org
> Reported-by: Vega <vega@nebusec.ai>
> Assisted-by: Codex:gpt-5.4
> Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
> ---
> changes in v2:
>   - Extend best-effort notification handling to tunnel_modify.
>   - Follow the existing bare-call style instead of explicit (void) casts.
>   - Document the observed ENOBUFS and committed-state reproduction.
>   - v1 Link: https://lore.kernel.org/all/cover.1786962220.git.zihanx@nebusec.ai/

Thanks for the updates.

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-24 11:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1787247008.git.zihanx@nebusec.ai>
2026-08-20 18:40 ` [PATCH net v2 1/1] net: l2tp: do not propagate multicast notification errors Zihan Xi
2026-08-24 11:21   ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox