[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YsWXeLo9gXTEv3pw@casper.infradead.org>
Date: Wed, 6 Jul 2022 15:08:56 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Liu Shixin <liushixin2@...wei.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Jan Kara <jack@...e.cz>,
William Kucharski <william.kucharski@...cle.com>,
Christoph Hellwig <hch@....de>, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH 5.15 v3] mm/filemap: fix UAF in find_lock_entries
On Wed, Jul 06, 2022 at 03:45:27PM +0800, Liu Shixin wrote:
> rcu_read_lock();
> while ((page = find_get_entry(&xas, end, XA_PRESENT))) {
> + unsigned long next_idx = xas.xa_index;
It's confusing to have next_idx not be the actual next index.
That was why I made it 'xas.xa_index + 1'. I know it's somewhat
used as an indicator that we don't need to call xas_set(), and so
it doesn't really matter, but let's say what we mean.
Powered by blists - more mailing lists