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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 19 Dec 2013 09:24:54 +0800
From:	Ding Tianhong <dingtianhong@...wei.com>
To:	Joe Perches <joe@...ches.com>
CC:	Ding Tianhong <dthxman@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2 0/6] slight optimization of addr compare for
 some modules

On 2013/12/19 0:51, Joe Perches wrote:
> On Wed, 2013-12-18 at 18:06 +0800, Ding Tianhong wrote:
>> On 2013/12/18 17:17, Joe Perches wrote:
>>> On Wed, 2013-12-18 at 16:47 +0800, Ding Tianhong wrote:
>>>> On 2013/12/17 9:58, Ding Tianhong wrote:
>>>>> On 2013/12/17 1:25, Joe Perches wrote:
>>>>>> These should still be inspected for appropriate use of
>>>>>> ether_addr_equal or ether_addr_equal_unaligned, but a
>>>>>> better cocci input sp-file is:
>>>>>>
>>>>>> $ cat ether_addr_equal_unaligned.cocci 
>>>>>> @@
>>>>>> expression e1;
>>>>>> expression e2;
>>>>>> @@
>>> []
>>>> There are too many places need to be changed, should I make it in one patch or several pathset,
>>>> pls give me some advise. thanks
>>>
>>> Separate per-maintainer patches are generally good.
>>> It can take several attempts to get these applied
>>> in all the various trees.
>>>
>>> So maybe 1 patch for each of most of these.  Maybe
>>> some of these like drivers/media, drivers/mtd and
>>> drivers/staging could probably be single patches.
>>>
>>
>> Hi Joe:
>>
>> I found there is a bug in spatch, it could not deal with 
>> -       memcmp(e1, e2, \(6\|ETH_ALEN\)) != 0
>> +       !ether_addr_equal_unaligned(e1, e2)
> 
> Not an spatch bug but a defect in the ordering of
> transforms in the ether_addr_equal_unaligned.cocci file
> 
> This should be better:
> 
> $ cat ether_addr_equal_unaligned.cocci
> @@
> expression e1;
> expression e2;
> @@
> 
> -	memcmp(e1, e2, \(6\|ETH_ALEN\)) == 0
> +	ether_addr_equal_unaligned(e1, e2)
> 
> @@
> expression e1;
> expression e2;
> @@
> 
> -	memcmp(e1, e2, \(6\|ETH_ALEN\)) != 0
> +	!ether_addr_equal_unaligned(e1, e2)
> 
> @@
> expression e1;
> expression e2;
> @@
> 
> -	!memcmp(e1, e2, \(6\|ETH_ALEN\))
> +	ether_addr_equal_unaligned(e1, e2)
> 
> @@
> expression e1;
> expression e2;
> @@
> 
> -	memcmp(e1, e2, \(6\|ETH_ALEN\))
> +	!ether_addr_equal_unaligned(e1, e2)
> 
> 
> 

Yes, it could works well, thanks a lot.

Regards
Ding

> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ