lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170704.032833.2030036660842556798.davem@davemloft.net>
Date:   Tue, 04 Jul 2017 03:28:33 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     linyunsheng@...wei.com
Cc:     huangdaode@...ilicon.com, xuwei5@...ilicon.com,
        liguozhu@...ilicon.com, Yisen.Zhuang@...wei.com,
        gabriele.paoloni@...wei.com, john.garry@...wei.com,
        linuxarm@...wei.com, salil.mehta@...wei.com, lipeng321@...wei.com,
        tremyfr@...il.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net 1/3] net: hns: Add TX CSUM check when fill TX
 description

From: Lin Yun Sheng <linyunsheng@...wei.com>
Date: Tue, 4 Jul 2017 18:47:31 +0800

> From: Yunsheng Lin <linyunsheng@...wei.com>
> 
> If driver support checksum offload, should check netdev feature
> before fill TX description and get CSUM err bit from RX
> description. HNS driver do the check in RX derction but it doesn't
> do the check in TX direction.
> 
> Signed-off-by: lipeng <lipeng321@...wei.com>
> Reviewed-by: Daode Huang <huangdaode@...ilicon.com>
> Reviewed-by: Yunsheng Lin <linyunsheng@...wei.com>

This is not correct.

You should be checking the skb->checksum field to decide if you should
offload the TX checksum of the packet or not.

Correct drivers, as far as I am aware, do not check the feature flags
so I wonder where you got this idea from.  Always use other well
established existing drivers as a model for how to handle things like
this.

And this makes sense.  An SKB can have it's checksumming determination
made first, then the netdev feature change is made afterwards.  For
correctness you still need to TX checksum offload that SKB otherwise
it will be emitted without a correctly computed checksum.

Thank you.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ