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: <20170105114804.GE13756@mwanda>
Date:   Thu, 5 Jan 2017 14:48:04 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Long Li <longli@...hange.microsoft.com>
Cc:     devel@...uxdriverproject.org,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hv: use substraction to update ring buffer index

On Thu, Jan 05, 2017 at 02:39:55PM +0300, Dan Carpenter wrote:
> > @@ -179,7 +180,8 @@ static u32 hv_copyfrom_ringbuffer(
> >  	memcpy(dest, ring_buffer + start_read_offset, destlen);
> >  
> >  	start_read_offset += destlen;
> > -	start_read_offset %= ring_buffer_size;
> > +	if (start_read_offset >= ring_buffer_size)
> > +		start_read_offset -= ring_buffer_size;
> 
> I totally don't understand the original code here.  We do the memset

I meant memcpy() not memset.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ