From: Steffen Klassert <steffen.klassert@secunet.com>
To: Roshan Kumar <roshaen09@gmail.com>
Cc: <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
<chopps@labn.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <horms@kernel.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] xfrm: iptfs: validate inner IPv4 header length in IPTFS payload
Date: Wed, 4 Mar 2026 11:04:27 +0100 [thread overview]
Message-ID: <aagDqygQrWHBLoKV@secunet.com> (raw)
In-Reply-To: <20260301105638.11479-1-roshaen09@gmail.com>
On Sun, Mar 01, 2026 at 10:56:38AM +0000, Roshan Kumar wrote:
> Add validation of the inner IPv4 packet tot_len and ihl fields parsed
> from decrypted IPTFS payloads in __input_process_payload(). A crafted
> ESP packet containing an inner IPv4 header with tot_len=0 causes an
> infinite loop: iplen=0 leads to capturelen=min(0, remaining)=0, so the
> data offset never advances and the while(data < tail) loop never
> terminates, spinning forever in softirq context.
>
> Reject inner IPv4 packets where tot_len < ihl*4 or ihl*4 < sizeof(struct
> iphdr), which catches both the tot_len=0 case and malformed ihl values.
> The normal IP stack performs this validation in ip_rcv_core(), but IPTFS
> extracts and processes inner packets before they reach that layer.
>
> Reported-by: Roshan Kumar <roshaen09@gmail.com>
> Fixes: 6c82d2433671 ("xfrm: iptfs: add basic receive packet (tunnel egress) handling")
> Cc: stable@vger.kernel.org
> Signed-off-by: Roshan Kumar <roshaen09@gmail.com>
Applied to the ipsec tree, thanks a lot!
prev parent reply other threads:[~2026-03-04 10:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-01 10:56 [PATCH] xfrm: iptfs: validate inner IPv4 header length in IPTFS payload Roshan Kumar
2026-03-04 10:04 ` 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=aagDqygQrWHBLoKV@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=chopps@labn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=roshaen09@gmail.com \
--cc=stable@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