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:	Thu, 24 Feb 2011 13:38:00 +0100
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Hugh Dickins <hughd@...gle.com>
Cc:	Nick Piggin <npiggin@...nel.dk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Wu Fengguang <fengguang.wu@...el.com>,
	Salman Qazi <sqazi@...gle.com>, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org
Subject: Re: [PATCH] mm: remove worrying dead code from find_get_pages()

On Wed, 2011-02-23 at 21:31 -0800, Hugh Dickins wrote:
> The radix_tree_deref_retry() case in find_get_pages() has a strange
> little excrescence, not seen in the other gang lookups: it looks like
> the start of an abandoned attempt to guarantee forward progress in a
> case that cannot arise.
> 
> ret should always be 0 here: if it isn't, then going back to restart
> will leak references to pages already gotten.  There used to be a
> comment saying nr_found is necessarily 1 here: that's not quite true,
> but the radix_tree_deref_retry() case is peculiar to the entry at index
> 0, when we race with it being moved out of the radix_tree root or back.
> 
> Remove the worrisome two lines, add a brief comment here and in
> find_get_pages_contig() and find_get_pages_tag(), and a WARN_ON
> in find_get_pages() should it ever be seen elsewhere than at 0.
> 
> Signed-off-by: Hugh Dickins <hughd@...gle.com>

Acked-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>


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