From: Eric Dumazet <eric.dumazet@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>,
Eric Dumazet <eric.dumazet@gmail.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
Eric Dumazet <edumazet@google.com>
Subject: Re: [Patch net] net: make pskb_trim_rcsum_slow() robust
Date: Mon, 29 Oct 2018 20:08:44 -0700 [thread overview]
Message-ID: <f0639ba8-ba57-4782-1133-443b51d61bb0@gmail.com> (raw)
In-Reply-To: <CAM_iQpXqJyK4zKiDNBMnX4GRa2Wt=9iAYvXORzs0wMkk+1=Qvg@mail.gmail.com>
On 10/29/2018 07:41 PM, Cong Wang wrote:
> On Mon, Oct 29, 2018 at 7:25 PM Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>
>>
>>
>> On 10/29/2018 07:21 PM, Cong Wang wrote:
>>> On Mon, Oct 29, 2018 at 7:14 PM Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>>>
>>>> Would not it be simpler to set ip_summed to CHECKSUM_NONE (no need to save old_csum) ?
>>>
>>> For !CHECKSUM_COMPLETE, ip_summed should be untouched, right?
>>>
>>> If you mean only setting to CHECKSUM_NONE for CHECKSUM_COMPLETE case,
>>> the end result may not be simpler.
>>
>> I meant to reinstate what was there before my patch in this error case
>>
>> if (skb->ip_summed == CHECKSUM_COMPLETE)
>> skb->ip_summed = CHECKSUM_NONE;
>>
>> That would only be run in error (quite unlikely) path, instead of saving old_csum in all cases.
>
> I know your point, however, I am not sure that is a desired behavior.
>
> On failure, I think the whole skb should be restored to its previous state
> before entering this function, changing it to CHECKSUM_NONE on failure
> is inconsistent with success case.
>
Before my patch, we were changing skb->ip_summed to CHECKSUM_NONE,
so why suddenly we need to be consistent ?
In any case, ip_check_defrag() should really drop this skb, as for other allocation
failures (like skb_share_check()), if really we want consistency.
next prev parent reply other threads:[~2018-10-30 12:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 0:35 [Patch net] net: make pskb_trim_rcsum_slow() robust Cong Wang
2018-10-30 2:14 ` Eric Dumazet
2018-10-30 2:21 ` Cong Wang
2018-10-30 2:25 ` Eric Dumazet
2018-10-30 2:41 ` Cong Wang
2018-10-30 3:08 ` Eric Dumazet [this message]
2018-10-30 18:57 ` Cong Wang
2018-10-31 19:36 ` David Miller
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=f0639ba8-ba57-4782-1133-443b51d61bb0@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@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