From: Ido Schimmel <idosch@nvidia.com>
To: Justin Iurman <justin.iurman@gmail.com>
Cc: Ren Wei <n05ec@lzu.edu.cn>,
netdev@vger.kernel.org, dsahern@kernel.org,
yoshfuji@linux-ipv6.org, nakam@linux-ipv6.org,
davem@davemloft.net, yuantan098@gmail.com, bird@lzu.edu.cn,
tr0jan@lzu.edu.cn, zcliangcn@gmail.com
Subject: Re: [PATCH net 1/1] ipv6: exthdrs: refresh nh after handling HAO option
Date: Sun, 24 May 2026 17:26:39 +0300 [thread overview]
Message-ID: <20260524142639.GA93154@shredder> (raw)
In-Reply-To: <ed9cf618-a5b6-4343-9f20-b51b3814acaa@gmail.com>
On Fri, May 22, 2026 at 01:30:40PM +0200, Justin Iurman wrote:
> On 5/22/26 11:42, Ren Wei wrote:
> > From: Zhengchuan Liang <zcliangcn@gmail.com>
> >
> > ip6_parse_tlv() caches skb_network_header(skb) in nh while walking
> > IPv6 TLVs.
> >
> > ipv6_dest_hao() may call pskb_expand_head() for a cloned skb, which can
> > move the skb head and invalidate the cached network header pointer.
> > Refresh nh after ipv6_dest_hao() returns so any trailing padding or TLVs
> > are parsed from the current skb head.
> >
> > This matches the existing pattern used in ip6_parse_tlv() after helpers
> > that can modify skb header storage.
> >
> > Fixes: a831f5bbc89a ("[IPV6] MIP6: Add inbound interface of home address option.")
> > Cc: stable@kernel.org
> > Reported-by: Yuan Tan <yuantan098@gmail.com>
> > Reported-by: Xin Liu <bird@lzu.edu.cn>
> > Co-developed-by: Luxing Yin <tr0jan@lzu.edu.cn>
> > Signed-off-by: Luxing Yin <tr0jan@lzu.edu.cn>
> > Signed-off-by: Zhengchuan Liang <zcliangcn@gmail.com>
> > Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
> > Assisted-by: Codex:gpt-5.4
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
> > ---
> > net/ipv6/exthdrs.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
> > index 47c5502a34a2..751e07392aae 100644
> > --- a/net/ipv6/exthdrs.c
> > +++ b/net/ipv6/exthdrs.c
> > @@ -201,6 +201,8 @@ static bool ip6_parse_tlv(bool hopbyhop,
> > case IPV6_TLV_HAO:
> > if (!ipv6_dest_hao(skb, off))
> > return false;
> > +
> > + nh = skb_network_header(skb);
> > break;
> > #endif
> > default:
>
> Reviewed-by: Justin Iurman <justin.iurman@gmail.com>
>
> Note that the same issue applies to IPV6_TLV_JUMBO (hopopts), I've sent a
> patch to fix it as well (see [1]). Which makes me wonder... at some point,
> we may refresh the nh pointer once by default, regardless of the option. The
> impact wouldn't be that huge, and it would avoid missing the above for
> similar (new) cases.
+1
Do you want to send such a patch to net-next once both patches are
present there?
prev parent reply other threads:[~2026-05-24 14:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1779247873.git.zcliangcn@gmail.com>
2026-05-22 9:42 ` [PATCH net 1/1] ipv6: exthdrs: refresh nh after handling HAO option Ren Wei
2026-05-22 11:30 ` Justin Iurman
2026-05-24 14:26 ` Ido Schimmel [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=20260524142639.GA93154@shredder \
--to=idosch@nvidia.com \
--cc=bird@lzu.edu.cn \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=justin.iurman@gmail.com \
--cc=n05ec@lzu.edu.cn \
--cc=nakam@linux-ipv6.org \
--cc=netdev@vger.kernel.org \
--cc=tr0jan@lzu.edu.cn \
--cc=yoshfuji@linux-ipv6.org \
--cc=yuantan098@gmail.com \
--cc=zcliangcn@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