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] [thread-next>] [day] [month] [year] [list]
Message-ID: <8729016553E3654398EA69218DA29EEF15BC8EFC@cnshjmbx02>
Date:   Thu, 15 Jun 2017 07:05:30 +0000
From:   YUAN Linyu <Linyu.Yuan@...atel-sbell.com.cn>
To:     Johannes Berg <johannes@...solutions.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [RFC] networking: convert many more places to skb_put_zero()



> -----Original Message-----
> From: Johannes Berg [mailto:johannes@...solutions.net]
> Sent: Thursday, June 15, 2017 2:58 PM
> To: YUAN Linyu; netdev@...r.kernel.org
> Subject: Re: [RFC] networking: convert many more places to skb_put_zero()
> 
> On Thu, 2017-06-15 at 00:23 +0000, YUAN Linyu wrote:
> > Hi,
> > Indeed, it find more.
> > Compare with my patch, still lost pattern like below,
> > 1. sctp and openvswitch
> > --- a/net/sctp/output.c
> > +++ b/net/sctp/output.c
> > @@ -463,7 +463,7 @@ static int sctp_packet_pack(struct sctp_packet
> > *packet,
> >
> >  			padding = SCTP_PAD4(chunk->skb->len) -
> > chunk->skb->len;
> >  			if (padding)
> > -				memset(skb_put(chunk->skb, padding),
> > 0, padding);
> > +				skb_put_zero(chunk->skb, padding);
> 
> Yep, good catch, this finds 18 instances thereof:
> 
> @@
> expression skb, len;
> @@
> -memset(skb_put(skb, len), 0, len);
> +skb_put_zero(skb, len);
> 
> 
> > --- a/net/dsa/tag_trailer.c
> > +++ b/net/dsa/tag_trailer.c
> > @@ -43,8 +43,7 @@ static struct sk_buff *trailer_xmit(struct sk_buff
> > *skb, struct net_device *dev)
> >  	kfree_skb(skb);
> >
> >  	if (padlen) {
> > -		u8 *pad = skb_put(nskb, padlen);
> > -		memset(pad, 0, padlen);
> > +		skb_put_zero(nskb, padlen);
> 
> I'd have thought it finds this, but indeed it doesn't; there's only one
> instances this changes though:
> 
> @@
> type t;
> expression skb, len;
> identifier p;
> @@
> t *p
> - = skb_put(skb, len);
> + = skb_put_zero(skb, len);
> -memset(p, 0, len);
> 
> and it can't figure out that it should remove the variable, without
> much more work that's not really worth it for one instance :)
Yes, I agree, 
it conflict with previous spatch which will keep "pad" variable, right?

I can do it by hand if spatch not work
> 
> johannes

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ