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]
Date:	Fri, 1 Jul 2011 11:38:50 +0300
From:	Dan Carpenter <error27@...il.com>
To:	Dan Magenheimer <dan.magenheimer@...cle.com>
Cc:	Greg Kroah-Hartman <gregkh@...e.de>,
	Marcus Klemm <marcus.klemm@...glemail.com>,
	kvm@...r.kernel.org, Konrad Wilk <konrad.wilk@...cle.com>,
	linux-kernel@...r.kernel.org, linux-mm <linux-mm@...ck.org>,
	Seth Jennings <sjenning@...ux.vnet.ibm.com>,
	devel@...uxdriverproject.org
Subject: Re: [PATCH v2] staging: zcache: support multiple clients, prep for
 KVM and RAMster

On Thu, Jun 30, 2011 at 04:28:14PM -0700, Dan Magenheimer wrote:
> Hi Dan --
> 
> Thanks for the careful review.  You're right... some
> of this was leftover from debugging an off-by-one error,
> though the code as is still works.
> 
> OTOH, there's a good chance that much of this sysfs
> code will disappear before zcache would get promoted
> out of staging, since it is to help those experimenting
> with zcache to get more insight into what the underlying
> compression/accept-reject algorithms are doing.
> 
> So I hope you (and GregKH) are OK that another version is
> not necessary at this time to fix these.

Off by one errors are kind of insidious.  People cut and paste them
and they spread.  If someone adds a new list of chunks then there
are now two examples that are correct and two which have an extra
element, so it's 50/50 that he'll copy the right one.

Btw, looking at it again, this seems like maybe a similar issue in
zbud_evict_zbpg():

   515          /* now try freeing unbuddied pages, starting with least space avail */
   516          for (i = 0; i < MAX_CHUNK; i++) {
   517  retry_unbud_list_i:


MAX_CHUNKS is NCHUNKS - 1.  Shouldn't that be i < NCHUNKS so that we
reach the last element in the list?

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ