[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZEpuZGMY3AQq/H4D@osiris>
Date: Thu, 27 Apr 2023 14:45:24 +0200
From: Heiko Carstens <hca@...ux.ibm.com>
To: Claudio Imbrenda <imbrenda@...ux.ibm.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-s390@...r.kernel.org, frankja@...ux.ibm.com,
borntraeger@...ibm.com, nrb@...ux.ibm.com, nsg@...ux.ibm.com,
seiden@...ux.ibm.com, jgg@...dia.com
Subject: Re: [PATCH v2 1/1] KVM: s390: fix race in gmap_make_secure
On Thu, Apr 27, 2023 at 02:17:11PM +0200, Claudio Imbrenda wrote:
> > > > On Wed, Apr 26, 2023 at 03:48:34PM +0200, Claudio Imbrenda wrote:
> > > > > This patch fixes a potential race in gmap_make_secure and removes the
> > > > > last user of follow_page without FOLL_GET.
> > > > >
> > > > > Signed-off-by: Claudio Imbrenda <imbrenda@...ux.ibm.com>
> > > > > Suggested-by: Jason Gunthorpe <jgg@...dia.com>
> > > > > Fixes: 214d9bbcd3a6 ("s390/mm: provide memory management functions for protected KVM guests")
> > > > > ---
> > > > > arch/s390/kernel/uv.c | 32 +++++++++++---------------------
> > > > > 1 file changed, 11 insertions(+), 21 deletions(-)
> > > >
> > > > It would be helpful if this would be a bit more descriptive. "Fix
> > > > race" is not very helpful :)
> > > >
> > > > What race does this fix?
> > > > When can this happen?
> > > > What are the consequences if the race window is being hit?
> > >
> > > We are locking something we don't have a reference to, and as explained
> > > by Jason and David in this thread <Y9J4P/RNvY1Ztn0Q@...dia.com> it can
> > > lead to all kind of bad things, including the page getting
> > > unmapped (MADV_DONTNEED), freed, reallocated as a larger folio and the
> > > unlock_page() would target the wrong bit.
> > >
> > > Also there is another race with the FOLL_WRITE, which could race
> > > between the follow_page and the get_locked_pte.
> > >
> > > The main point of the patch is to remove the last follow_page without
> > > FOLL_GET or FOLL_PIN, removing the races can be considered a nice bonus.
> >
> > I've seen that discussion. What I'm actually asking for is that all of
> > this information should be added to the commit description. Nobody
> > will remember any of the details in one year.
>
> I will put it in the patch description.
>
> do you think the text above is enough?
Fine with me. With a proper Link: tag this is much better than before.
Thanks!
Powered by blists - more mailing lists