From: netdev-bot+sashiko@kernel.org
To: toddfreed@meta.com
Cc: netdev@vger.kernel.org, davem@davemloft.net,
andrew+netdev@lunn.ch, bjorn@kernel.org, borisp@nvidia.com,
cratiu@nvidia.com, daniel.zahka@gmail.com, dsahern@kernel.org,
dtatulea@nvidia.com, edumazet@kernel.org, idosch@nvidia.com,
kuba@kernel.org, john.fastabend@gmail.com, leon@kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-rdma@vger.kernel.org, mbloch@nvidia.com, pabeni@redhat.com,
raeds@nvidia.com, rrameshbabu@nvidia.com, sd@queasysnail.net,
saeedm@nvidia.com, shuah@kernel.org, horms@kernel.org,
tariqt@nvidia.com, weiwan@google.com,
willemdebruijn.kernel@gmail.com, stable@vger.kernel.org
Subject: Re: [PATCH net v6 5/8] ipv6: icmpv6: don't quote decrypted payload in icmpv6 errors
Date: Sat, 21 Nov 2026 21:17:42 +0000 [thread overview]
Message-ID: <179529586258.3135.12190616828136497053@kernel.org> (raw)
In-Reply-To: <20261117203137.804424-6-toddfreed@meta.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 0
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).
- [High] The fix is incomplete on IPv6.
--
ipv6: icmpv6: don't quote decrypted payload in icmpv6 errors
This commit stops icmp6_send() from sending an error about a received skb
that the device has decrypted (skb->decrypted). An error about a locally
originated decrypted skb is still sent, but only if its route goes to a
local address (RTF_LOCAL). This follows the earlier IPv4 patch for
__icmp_send().
> diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
> index d8203ebad8827..574a42d279e03 100644
> --- a/net/ipv6/icmp.c
> +++ b/net/ipv6/icmp.c
> @@ -778,6 +778,15 @@ void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
>
> np = inet6_sk(sk);
>
> + /* Don't send parts of a decrypted skb onto the network, see
> + * __icmp_send(): no error about a received skb. Before the rate
> + * limit, so that such an error costs no credit. The check of a
> + * locally originated skb below needs the route of the error, which
> + * is looked up after the rate limit.
> + */
> + if (unlikely(skb_is_decrypted(skb) && skb->skb_iif))
> + goto out_unlock;
> +
[Severity: High]
Does this cover the NDISC Redirect sent from ip6_forward()? That path also
quotes the invoking packet, but it never goes through icmp6_send():
net/ipv6/ip6_output.c:ip6_forward() {
...
if (IP6CB(skb)->iif == dev->ifindex &&
opt->srcrt == 0 && !skb_sec_path(skb)) {
...
if (peer && inet_peer_xrlim_allow(peer, 1*HZ))
ndisc_send_redirect(skb, target);
...
}
None of these conditions look at skb->decrypted. ndisc_send_redirect()
then copies up to about 1200 bytes of the original packet into a new skb
from ndisc_alloc_skb(), and that skb is not marked decrypted:
net/ipv6/ndisc.c:ndisc_send_redirect() {
...
rd_len = min_t(unsigned int,
IPV6_MIN_MTU - sizeof(struct ipv6hdr) - sizeof(*msg) - optlen,
skb->len + 8);
...
if (rd_len)
ndisc_fill_redirect_hdr_option(buff, skb, rd_len);
skb_dst_set(buff, dst);
ndisc_send_skb(buff, &ipv6_hdr(skb)->saddr, &saddr_buf);
...
}
ndisc_fill_redirect_hdr_option() calls skb_copy_bits() starting at the
network header of the original skb. The decrypted L3/L4/payload bytes
would then go out in cleartext inside the Redirected Header option.
sk_validate_xmit_skb() drops the forwarded packet itself ("unencrypted skb
with no associated socket"). That leaves the redirect as the only way this
plaintext gets out of the host.
On IPv4, the call chain ip_forward()->ip_rt_send_redirect()->icmp_send()->
__icmp_send() reaches the check from the previous patch, because skb_iif
is set. The commit message says:
as in the previous patch for icmp, don't send an error about a received
decrypted skb at all
For redirects, though, IPv6 does not match IPv4. Nothing later in the
series seems to change this.
As for how a decrypted skb gets to ip6_forward(): the mlx5 PSP RX decrypt
rule in setup_fte_udp_psp() matches only on ip_protocol == IPPROTO_UDP and
the UDP dport. It does not match on the destination address.
mlx5e_psp_offload_handle_rx_skb() then sets skb->decrypted. With
forwarding enabled, a PSP packet sent to a non-local IPv6 address would be
decrypted and then forwarded.
kTLS RX offload can also produce a decrypted skb whose destination is no
longer local. One example is when the local address is removed while the
offload is still active.
The !skb_sec_path() condition already keeps redirects from quoting frames
decapsulated by IPsec. Would a similar skb_is_decrypted() check make sense,
either in the redirect condition in ip6_forward() or in
ndisc_send_redirect()?
> if (!icmpv6_xrlim_allow(sk, type, &fl6, apply_ratelimit))
> goto out_unlock;
>
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117203137.804424-1-toddfreed%40meta.com
next prev parent reply other threads:[~2026-11-21 21:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 20:31 [PATCH net v6 0/8] psp, tls: don't send offloaded contents in cleartext Todd Freed
2026-11-17 20:31 ` [PATCH net v6 1/8] net/mlx5e: ring the tx doorbell when an accel offload drops a packet Todd Freed
2026-11-18 14:08 ` Dragos Tatulea
2026-11-21 21:17 ` netdev-bot+sashiko
2026-11-17 20:31 ` [PATCH net v6 2/8] psp: don't encapsulate ipv6 packets with extension headers Todd Freed
2026-11-17 20:31 ` [PATCH net v6 3/8] net: don't fragment decrypted skbs Todd Freed
2026-11-21 21:17 ` netdev-bot+sashiko
2026-11-17 20:31 ` [PATCH net v6 4/8] ipv4: icmp: don't quote decrypted payload in icmp errors Todd Freed
2026-11-21 21:17 ` netdev-bot+sashiko
2026-11-17 20:31 ` [PATCH net v6 5/8] ipv6: icmpv6: don't quote decrypted payload in icmpv6 errors Todd Freed
2026-11-21 21:17 ` netdev-bot+sashiko [this message]
2026-11-17 20:31 ` [PATCH net v6 6/8] selftests: drv-net: psp: test ipv6 tcp socket with extension headers Todd Freed
2026-11-17 20:31 ` [PATCH net v6 7/8] selftests: drv-net: psp: test that ipv4 psp packets aren't fragmented Todd Freed
2026-11-17 20:31 ` [PATCH net v6 8/8] net/mlx5e: psp: tso: replace only the length in checksum seed Todd Freed
2026-11-18 14:24 ` Dragos Tatulea
2026-11-20 17:17 ` Todd Bert Freed
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=179529586258.3135.12190616828136497053@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bjorn@kernel.org \
--cc=borisp@nvidia.com \
--cc=cratiu@nvidia.com \
--cc=daniel.zahka@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=dtatulea@nvidia.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=raeds@nvidia.com \
--cc=rrameshbabu@nvidia.com \
--cc=saeedm@nvidia.com \
--cc=sd@queasysnail.net \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tariqt@nvidia.com \
--cc=toddfreed@meta.com \
--cc=weiwan@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®