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:	Thu, 23 Aug 2012 15:46:19 -0700 (PDT)
From:	Hugh Dickins <hughd@...gle.com>
To:	Jeff Moyer <jmoyer@...hat.com>
cc:	"Richard W.M. Jones" <rjones@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Jens Axboe <jaxboe@...ionio.com>,
	Torsten Hilbrich <torsten.hilbrich@...unet.com>,
	Josh Boyer <jwboyer@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: replace __getblk_slow misfix by grow_dev_page
 fix

On Thu, 23 Aug 2012, Jeff Moyer wrote:
> Hugh Dickins <hughd@...gle.com> writes:
> 
> > [PATCH] block: replace __getblk_slow misfix by grow_dev_page fix
> >
> > Commit 91f68c89d8f3 ("block: fix infinite loop in __getblk_slow")
> > is not good: a successful call to grow_buffers() cannot guarantee
> > that the page won't be reclaimed before the immediate next call to
> > __find_get_block(), which is why there was always a loop there.
> [snip]
> > Revert 91f68c89d8f3, restoring __getblk_slow() to how it was (plus
> > a checkpatch nitfix).  Simplify the interface between grow_buffers()
> > and grow_dev_page(), and avoid the infinite loop beyond end of device
> > by instead checking init_page_buffers()'s end_block there (I presume
> > that's more efficient than a repeated call to blkdev_max_block()),
> > returning -ENXIO to __getblk_slow() in that case.
> >
> > And remove akpm's ten-year-old "__getblk() cannot fail ... weird"
> > comment, but that is worrying: are all users of __getblk() really
> > now prepared for a NULL bh beyond end of device, or will some oops??
> 
> Hi, Hugh,
> 
> Thanks for digging into this.  I had wondered whether that loop was
> required for other purposes, and you've verified that it was.  I mostly
> like your fix.  Returning end_block from init_page_buffers is a little
> strange,

It is a little strange, I agree.  I wrestled a lot with the way block
and end_block were known at opposite ends of the callstack, and needed
to be brought together for the check.

If you think it would be better to move the blkdev_max_block()
lookup up a level into grow_dev_page(), then pass end_block down to
init_page_buffers(), that could work as well; though we'd then still
need to report "failure" from init_page_buffers().

I was inclined to leave it precisely where you had sited it, with that
comment on passing it back up; but could change it around if preferred.

> but I understand not wanting to redo the call to blkdev_max_block.
> 
> I went ahead to re-tested with the reproducer that I had, and your patch
> works fine.  Thanks again for tracking this down, and sorry I wasn't
> more diligent to begin with.
> 
> Reviewed-and-Tested-by: Jeff Moyer <jmoyer@...hat.com>

Great, thanks a lot.  It (but equally its incorrect earlier version)
have been running fine at home under my swapping load.  I'm confident
that it fixes the issues I had been seeing, although, strictly speaking,
it'll take another two or three days to reach bisection confidence level.

Hugh
--
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