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: <1488609447.2179.47.camel@perches.com>
Date:   Fri, 03 Mar 2017 22:37:27 -0800
From:   Joe Perches <joe@...ches.com>
To:     Ernestas Kulik <ernestas.kulik@...il.com>,
        gregkh@...uxfoundation.org
Cc:     devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: ks7010: clean up code

On Sat, 2017-03-04 at 08:28 +0200, Ernestas Kulik wrote:
> On Fri, 2017-03-03 at 17:23-0800, Joe Perches wrote:
> 
> > On Fri, 2017-03-03 at 22:58 +0200, Ernestas Kulik wrote:
> > 
> > > This fixes type warnings generated by sparse, replaces instances of
> > > ntohs() with be16_to_cpu() and removes unused fields in structs.
> > 
> > There's no real need to convert ntohs to be16_to_cpu
> 
> I noticed a patch that was merged that replaces calls to these with the
> more “generic” be16_to_cpu(), but I can revert that.
> 
> This kind of conversion also happened in SeaBIOS, but it’s not exactly
> the same thing as here.
> 
> > > diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
> > 
> > []
> > > 
> > > @@ -297,7 +297,8 @@ static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer,
> > >  	hdr = (struct hostif_hdr *)buffer;
> > >  
> > >  	DPRINTK(4, "size=%d\n", hdr->size);
> > > -	if (hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event) {
> > > +	if (le16_to_cpu(hdr->event) < HIF_DATA_REQ ||
> > > +	    HIF_REQ_MAX < le16_to_cpu(hdr->event)) {
> > > 
> > 
> > This isn't mentioned and doesn't match the commit message
> 
> It is and it does, but the commit message is a bit vague. I’ll try to
> expand it.

Not really.

struct hostif_hdr.event is declared at uint16_t
and not as __le16 so I believe this is incorrect
and actually introduces a sparse error.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ