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:   Tue, 17 Oct 2017 14:01:50 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Himanshu Jha <himanshujha199640@...il.com>
Cc:     bianpan2016@....com, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] usb: wusbcore: Use put_unaligned_le32

On Tue, Oct 17, 2017 at 05:20:29PM +0530, Himanshu Jha wrote:
> On Tue, Oct 17, 2017 at 11:51:14AM +0200, Greg KH wrote:
> > On Fri, Oct 06, 2017 at 08:38:07PM +0530, Himanshu Jha wrote:
> > > Use put_unaligned_le32 rather than using byte ordering function and
> > > memcpy which makes code clear.
> > > Also, add the header file where it is declared.
> > > 
> > > Done using Coccinelle and semantic patch used is :
> > > 
> > > @ rule1 @
> > > identifier tmp; expression ptr,x; type T;
> > > @@
> > > 
> > > - tmp = cpu_to_le32(x);
> > > 
> > >   <+... when != tmp
> > > - memcpy(ptr, (T)&tmp, ...);
> > > + put_unaligned_le32(x,ptr);
> > >   ...+>
> > > 
> > > @ depends on rule1 @
> > > type j; identifier tmp;
> > > @@
> > > 
> > > - j tmp;
> > >   ...when != tmp
> > > 
> > > Signed-off-by: Himanshu Jha <himanshujha199640@...il.com>
> > > ---
> > > v2:
> > > * added correct header file.
> > > 
> > >  drivers/usb/wusbcore/security.c | 9 ++++-----
> > >  1 file changed, 4 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/drivers/usb/wusbcore/security.c b/drivers/usb/wusbcore/security.c
> > > index 170f2c3..256b56f 100644
> > > --- a/drivers/usb/wusbcore/security.c
> > > +++ b/drivers/usb/wusbcore/security.c
> > > @@ -22,6 +22,7 @@
> > >   *
> > >   * FIXME: docs
> > >   */
> > > +#include <asm/unaligned.h>
> > 
> > Ick, really?  asm/ ?  As the first include?  That feels wrong, at the
> > very least, it needs to be at the end of the include list please.
> 
> I just sent a v3 patch with the necessary change!
> Also, would you mind explaining as to why asm/ should not be the first
> include ?

Do you see any other files that have it that way?  It's traditionally
last.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ