All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, dsahern@kernel.org, horms@kernel.org,
	willemdebruijn.kernel@gmail.com, aksecurity@gmail.com,
	noam.caspi@mail.huji.ac.il
Subject: Re: [PATCH net v2 4/4] selftests: net: Add exception cache tests
Date: Mon, 31 Aug 2026 09:59:13 +0300	[thread overview]
Message-ID: <20260831065913.GC3079008@shredder> (raw)
In-Reply-To: <20260828192344.2596928-5-idosch@nvidia.com>

On Fri, Aug 28, 2026 at 10:23:44PM +0300, Ido Schimmel wrote:
> Add a test for the IPv4 and IPv6 exception caches, covering the
> exceptions that are created in response to ICMP errors quoting a UDP
> packet.
> 
> The topology consists of a host (h1) that reaches a remote host (h2)
> via a router (r1), with a second router (r2) attached to the segment
> shared by h1 and r1. UDP packets are injected using a packet socket, so
> that an ICMP error quoting them is only matched to a socket when one was
> opened separately with the same source port. PMTU errors are provoked by
> lowering the MTU of the far end of the path and redirects by pointing
> r1's route towards h2 back over the segment it received the packet from.
> 
> The following is tested for both address families and for both PMTU and
> redirect exceptions:
> 
> * An error that is not matched to a socket creates an exception that
>   carries the new MTU or gateway.
> * An error that is matched to a socket creates the same exception.
> 
> The PMTU tests further verify that a lower PMTU replaces the one stored
> in the exception whereas a higher one does not, and that a socket which
> disabled PMTU discovery using IP{,V6}_PMTUDISC_OMIT gets the same
> exception as the other cases.
> 
> Without "ipv4: udp: Create exceptions before socket matching" and "ipv6:
> udp: Create exceptions before socket matching", the tests that do not
> open a socket fail:

Both of the comments from Sashiko are nits. The test passes when it
should and fails otherwise, so it's doing its job.

"
This isn't a bug, but a question about what the "with a socket" cases
assert. pmtu_socket(), pmtu_omit() and redirect_socket() only look at the
route exception, and with the two accompanying kernel changes that
exception is created before the socket lookup:
"

It asserts that an exception is created regardless of whether the ICMP
error matched a socket or not.

"
Is the ICMP input counter a strong enough barrier for this check?
"

Yes.

  reply	other threads:[~2026-08-31  6:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 19:23 [PATCH net v2 0/4] Mitigate a side channel in routing exception caches Ido Schimmel
2026-08-28 19:23 ` [PATCH net v2 1/4] ipv6: Fix redirect exception creation for UDP/RAW sockets Ido Schimmel
2026-08-28 19:23 ` [PATCH net v2 2/4] ipv4: udp: Create exceptions before socket matching Ido Schimmel
2026-08-28 19:44   ` David Ahern
2026-08-31  6:44   ` Ido Schimmel
2026-08-28 19:23 ` [PATCH net v2 3/4] ipv6: " Ido Schimmel
2026-08-28 19:44   ` David Ahern
2026-08-31  6:45   ` Ido Schimmel
2026-08-28 19:23 ` [PATCH net v2 4/4] selftests: net: Add exception cache tests Ido Schimmel
2026-08-31  6:59   ` Ido Schimmel [this message]
2026-09-01  3:10 ` [PATCH net v2 0/4] Mitigate a side channel in routing exception caches patchwork-bot+netdevbpf

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=20260831065913.GC3079008@shredder \
    --to=idosch@nvidia.com \
    --cc=aksecurity@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=noam.caspi@mail.huji.ac.il \
    --cc=pabeni@redhat.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.