From: Sasha Levin <sashal@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: zhong jiang <zhongjiang@huawei.com>,
gregkh@linuxfoundation.org, stable@vger.kernel.org,
vbabka@suse.cz, mhocko@suse.com, linux-mm@kvack.org
Subject: Re: [RPF STABLE PATCH] mm/memfd: should be lock the radix_tree when iterating its slot
Date: Thu, 24 Oct 2019 19:54:47 -0400 [thread overview]
Message-ID: <20191024235447.GD31224@sasha-vm> (raw)
In-Reply-To: <20191024174115.GI2963@bombadil.infradead.org>
On Thu, Oct 24, 2019 at 10:41:15AM -0700, Matthew Wilcox wrote:
>On Thu, Oct 24, 2019 at 11:03:20PM +0800, zhong jiang wrote:
>> By reviewing the code, I find that there is an race between iterate
>> the radix_tree and radix_tree_insert/delete. Because the former just
>> access its slot in rcu protected period. but it fails to prevent the
>> radix_tree from being changed.
>
>Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
>
>The locking here now matches the locking in memfd_tag_pins() that
>was changed in ef3038a573aa8bf2f3797b110f7244b55a0e519c (part of 4.20-rc1).
>I didn't notice that I was fixing a bug when I changed the locking.
>This bug has been present since 05f65b5c70909ef686f865f0a85406d74d75f70f
>(part of 3.17) so backports will need to go further back. This code has
>moved around a bit (mm/shmem.c) and the APIs have changed, so it will
>take some effort.
I've queued this up for 4.19. Patches for older branches are more than
welcome.
--
Thanks,
Sasha
next prev parent reply other threads:[~2019-10-24 23:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 15:03 zhong jiang
2019-10-24 17:41 ` Matthew Wilcox
2019-10-24 23:54 ` Sasha Levin [this message]
2019-10-25 15:17 ` Matthew Wilcox
2019-10-26 1:54 ` zhong jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191024235447.GD31224@sasha-vm \
--to=sashal@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=stable@vger.kernel.org \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=zhongjiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox