netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Parkin <tparkin@katalix.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] l2tp: fix ICMP error handling for UDP-encap sockets
Date: Tue, 7 May 2024 15:10:12 +0100	[thread overview]
Message-ID: <Zjo2RHSzCW2xGv7k@katalix.com> (raw)
In-Reply-To: <20240503153214.3432d313@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]

Thanks Jakub,

On  Fri, May 03, 2024 at 15:32:14 -0700, Jakub Kicinski wrote:
> Seems like we should target it at net? Description indicates it's 
> a clear regression.

Ack, I'll respin for net.

> not: the !tunnel can't happen, right?

Your question makes me realise that l2tp_udp_encap_err_recv is being
called in the same context as l2tp_udp_encap_recv, and so should be
using rcu_dereference_sk_user_data to access the tunnel handle rather
than l2tp_sk_to_tunnel.

I'll fix that in the respin.

However I note that l2tp_udp_encap_recv also checks for the tunnel
handle being NULL :-|

> nit: mismatch on the braces here, this would be more usual:
> 
> +	if (ip_hdr(skb)->version == IPVERSION) {
> +		if (inet_test_bit(RECVERR, sk))
> +			return ip_icmp_error(sk, skb, err, port, info, payload);
> +#if IS_ENABLED(CONFIG_IPV6)
> +	} else {
> +		if (inet6_test_bit(RECVERR6, sk))
> +			return ipv6_icmp_error(sk, skb, err, port, info, payload);
> +#endif
> +	}
> 
> +}

Thanks, I will fix this.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2024-05-07 14:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 14:03 [PATCH net-next] l2tp: fix ICMP error handling for UDP-encap sockets Tom Parkin
2024-04-30 16:37 ` James Chapman
2024-05-03 22:32 ` Jakub Kicinski
2024-05-07 14:10   ` Tom Parkin [this message]

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=Zjo2RHSzCW2xGv7k@katalix.com \
    --to=tparkin@katalix.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).