Netdev List
 help / color / mirror / Atom feed
From: Justin Iurman <justin.iurman@gmail.com>
To: Ido Schimmel <idosch@nvidia.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: Wed, 27 May 2026 21:15:33 +0200	[thread overview]
Message-ID: <5f04bbd3-ff5d-41f6-8e42-fd17740361a1@gmail.com> (raw)
In-Reply-To: <20260524142639.GA93154@shredder>

On 5/24/26 16:26, Ido Schimmel wrote:
> 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?

Sure, will do. In case I forget, don't hesitate to remind me offline.

  reply	other threads:[~2026-05-27 19:15 UTC|newest]

Thread overview: 5+ 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
2026-05-27 19:15       ` Justin Iurman [this message]
2026-05-25 18:20   ` patchwork-bot+netdevbpf

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=5f04bbd3-ff5d-41f6-8e42-fd17740361a1@gmail.com \
    --to=justin.iurman@gmail.com \
    --cc=bird@lzu.edu.cn \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=idosch@nvidia.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