mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: <davem@davemloft.net>, <dsahern@kernel.org>,
	<edumazet@google.com>, <pabeni@redhat.com>,
	<yoshfuji@linux-ipv6.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <simon.horman@corigine.com>
Subject: Re: [PATCH v2] ip6mr: Fix skb_under_panic in ip6mr_cache_report()
Date: Tue, 1 Aug 2023 14:28:21 +0800	[thread overview]
Message-ID: <f91c3fd7-8d7a-7a91-8d16-935c90ef9b5d@huawei.com> (raw)
In-Reply-To: <20230731200959.2019cb9c@kernel.org>

On 2023/8/1 11:09, Jakub Kicinski wrote:
> On Fri, 28 Jul 2023 20:17:03 +0800 Yue Haibing wrote:
>>  #ifdef CONFIG_IPV6_PIMSM_V2
>> +	int nhoff = skb_network_offset(pkt);
>>  	if (assert == MRT6MSG_WHOLEPKT || assert == MRT6MSG_WRMIFWHOLE)
>> -		skb = skb_realloc_headroom(pkt, -skb_network_offset(pkt)
>> -						+sizeof(*msg));
>> +		skb = skb_realloc_headroom(pkt, -nhoff + sizeof(*msg));
> 
> These changes look unnecessary. You can leave this code be (as ugly as
> it is)...
> 
>>  	else
>>  #endif
>>  		skb = alloc_skb(sizeof(struct ipv6hdr) + sizeof(*msg), GFP_ATOMIC);
>> @@ -1073,7 +1073,7 @@ static int ip6mr_cache_report(const struct mr_table *mrt, struct sk_buff *pkt,
>>  		   And all this only to mangle msg->im6_msgtype and
>>  		   to set msg->im6_mbz to "mbz" :-)
>>  		 */
>> -		skb_push(skb, -skb_network_offset(pkt));
>> +		__skb_pull(skb, nhoff);
> 
> .. and just replace the push here with:
> 
>   __skb_pull(skb, skb_network_offset(pkt));

Thanks, will do this in v3.
> 

      reply	other threads:[~2023-08-01  6:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28 12:17 Yue Haibing
2023-08-01  3:09 ` Jakub Kicinski
2023-08-01  6:28   ` YueHaibing [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=f91c3fd7-8d7a-7a91-8d16-935c90ef9b5d@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=simon.horman@corigine.com \
    --cc=yoshfuji@linux-ipv6.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

all inboxes | Powered by JetHome®