diff options
| author | Qihang <q.h.hack.winter@gmail.com> | 2026-09-23 16:41:23 +0800 |
|---|---|---|
| committer | Steffen Klassert <steffen.klassert@secunet.com> | 2026-09-30 07:54:33 +0200 |
| commit | 86de3a1118a16dbbbe5fabe9aa20ffb93c072ed5 (patch) | |
| tree | f14404f687daa6286329df81db277e8cd75639ab /scripts | |
| parent | 868f63c8bfafa9b827168c9126f85264c39c02ec (diff) | |
xfrm: interface: validate the IP header on xmit
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>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
