Netdev List
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Qihang <q.h.hack.winter@gmail.com>
Cc: <herbert@gondor.apana.org.au>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net v4] xfrm: interface: validate the IP header on xmit
Date: Fri, 2 Oct 2026 09:34:06 +0200	[thread overview]
Message-ID: <ar9ebhV0Ibg1x8L_@secunet.com> (raw)
In-Reply-To: <20260923084123.10734-1-q.h.hack.winter@gmail.com>

On Wed, Sep 23, 2026 at 04:41:23PM +0800, Qihang wrote:
> Packets injected into an xfrm interface (e.g. AF_PACKET on an xfrmi
> device) reach the xfrm output path without IP header validation, but
> xfrm4_transport_output() uses iph->ihl for __skb_pull() and memmove()
> and expects the header to be valid.
> 
> vti_tunnel_xmit() already calls pskb_inet_may_pull() before handing
> packets to the xfrm output path.  Do the same in xfrmi_xmit() and
> perform the header checks ip_rcv_core()/ip6_rcv_core() do on entry
> to the IP stack: reject wrong IP versions and malformed IPv4 header
> lengths.
> 
> Fixes: f203b76d7809 ("xfrm: Add virtual xfrm interfaces")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Qihang <q.h.hack.winter@gmail.com>

Applied to the ipsec tree, thanks a lot!

Please Cc all the maintainers on future patches, I've
amost overlooked this one.

      reply	other threads:[~2026-10-02  7:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  8:41 [PATCH net v4] xfrm: interface: validate the IP header on xmit Qihang
2026-10-02  7:34 ` Steffen Klassert [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=ar9ebhV0Ibg1x8L_@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=q.h.hack.winter@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