[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <09d9cb95-3414-ef29-de08-f4f2b22b7f77@oracle.com>
Date: Thu, 15 Oct 2020 08:53:59 -0600
From: Khalid Aziz <khalid.aziz@...cle.com>
To: Catalin Marinas <catalin.marinas@....com>
Cc: Jann Horn <jannh@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
sparclinux@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Christoph Hellwig <hch@...radead.org>,
Anthony Yznaga <anthony.yznaga@...cle.com>,
Will Deacon <will@...nel.org>,
linux-arm-kernel@...ts.infradead.org,
Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH 1/2] mm/mprotect: Call arch_validate_prot under mmap_lock
and with length
On 10/15/20 3:05 AM, Catalin Marinas wrote:
> On Wed, Oct 14, 2020 at 03:21:16PM -0600, Khalid Aziz wrote:
>> What FreeBSD does seems like a reasonable thing to do. Any way first
>> thing to do is to update sparc to use arch_validate_flags() and update
>> sparc_validate_prot() to not peek into vma without lock.
>
> If you go for arch_validate_flags(), I think sparc_validate_prot()
> doesn't need the vma at all.
Yes, the plan is to move vma flag check from sparc_validate_prot() to
arch_validate_flags()..
>
> BTW, on the ADI topic, I think you have a race in do_swap_page() since
> set_pte_at() is called before arch_do_swap_page(). So a thread in the
> same process would see the new mapping but the tags have not been
> updated yet. Unless sparc relies on the new user pte to be set, I think
> you can just swap the two calls.
>
Thanks for pointing that out. I will take a look at it.
--
Khalid
Powered by blists - more mailing lists