Re: [PATCH v3] ip6mr: Fix skb_under_panic in ip6mr_cache_report()

From: YueHaibing
Date: Tue Aug 01 2023 - 21:28:38 EST


On 2023/8/2 8:52, David Ahern wrote:
> On 8/1/23 2:11 PM, Jakub Kicinski wrote:
>> On Tue, 1 Aug 2023 09:51:29 +0200 Eric Dumazet wrote:
>>>> - skb_push(skb, -skb_network_offset(pkt));
>>>> + __skb_pull(skb, skb_network_offset(pkt));
>>>>
>>>> skb_push(skb, sizeof(*msg));
>>>> skb_reset_transport_header(skb);
>>>
>>> Presumably this code has never been tested :/
>>
>> Could have been tested on 32bit, I wonder if there is more such bugs :S
>
> that pattern shows up a few times:

Ok, I will test and fix these if any.
>
> net/ipv4/ah4.c: skb_push(skb, -skb_network_offset(skb));
> net/ipv4/esp4.c: skb_push(skb, -skb_network_offset(skb));
> net/ipv4/esp4_offload.c: skb_push(skb, -skb_network_offset(skb));
> net/ipv4/esp4_offload.c: skb_push(skb, -skb_network_offset(skb));
> net/ipv4/xfrm4_tunnel.c: skb_push(skb, -skb_network_offset(skb));
> net/ipv6/ah6.c: skb_push(skb, -skb_network_offset(skb));
> net/ipv6/esp6.c: skb_push(skb, -skb_network_offset(skb));
> net/ipv6/esp6_offload.c: skb_push(skb, -skb_network_offset(skb));
> net/ipv6/esp6_offload.c: skb_push(skb, -skb_network_offset(skb));
> net/ipv6/ip6mr.c: skb_push(skb, -skb_network_offset(pkt));
> net/ipv6/mip6.c: skb_push(skb, -skb_network_offset(skb));
> net/ipv6/mip6.c: skb_push(skb, -skb_network_offset(skb));
> net/ipv6/xfrm6_tunnel.c: skb_push(skb, -skb_network_offset(skb));
> net/xfrm/xfrm_ipcomp.c: skb_push(skb, -skb_network_offset(skb));
> .
>