From: Alistair Popple <apopple@nvidia.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
christian.koenig@amd.com, jhubbard@nvidia.com,
rcampbell@nvidia.com, Jason Gunthorpe <jgg@nvidia.com>
Subject: Re: [PATCH v2] mm/mmu_notifier.c: Fix race in mmu_interval_notifier_remove()
Date: Thu, 21 Apr 2022 17:06:52 +1000 [thread overview]
Message-ID: <87bkwuykbr.fsf@nvdebian.thelocal> (raw)
In-Reply-To: <20220420163516.ab713a22af375788a541f045@linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]
Andrew Morton <akpm@linux-foundation.org> writes:
> On Thu, 21 Apr 2022 09:21:06 +1000 Alistair Popple <apopple@nvidia.com> wrote:
>
>> >> As the wait_event() condition is true it will return immediately. This
>> >> can lead to use-after-free type errors if the caller frees the data
>> >> structure containing the interval notifier subscription while it is
>> >> still on a deferred list. Fix this by taking the appropriate lock when
>> >> reading invalidate_seq to ensure proper synchronisation.
>> >>
>> >> ...
>> >>
>> >> Fixes: 99cb252f5e68 ("mm/mmu_notifier: add an interval tree notifier")
>> >
>> > Do you think fix this should be backported into older kernels?
>>
>> Yes, I forgot to cc stable sorry.
>
> So we have actually seen these use-after-free errors?
I observed them whilst running stress testing during some development. You do
have to be pretty unlucky, but it lead to the usual problems of use-after-free
(memory corruption, kernel crash, difficult to diagnose WARN_ON, etc) so I think
it's worth backporting.
> Some description of the end-user visible impact is always helpful when
> deciding which trees need a patch.
>
>> Do you want me to resend with
>> 'Cc: stable@vger.kernel.org'?
>
> Thanks, I added that.
Thanks.
next prev parent reply other threads:[~2022-04-21 7:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 4:37 [PATCH v2] mm/mmu_notifier.c: Fix race in mmu_interval_notifier_remove() Alistair Popple
2022-04-20 22:11 ` Andrew Morton
2022-04-20 23:21 ` Alistair Popple
2022-04-20 23:35 ` Andrew Morton
2022-04-21 7:06 ` Alistair Popple [this message]
2022-04-21 13:14 ` Jason Gunthorpe
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=87bkwuykbr.fsf@nvdebian.thelocal \
--to=apopple@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=christian.koenig@amd.com \
--cc=jgg@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rcampbell@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.