[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200707031424.GD25523@casper.infradead.org>
Date: Tue, 7 Jul 2020 04:14:24 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
Cc: x86@...nel.org, linux-sgx@...r.kernel.org,
linux-kernel@...r.kernel.org,
Sean Christopherson <sean.j.christopherson@...el.com>,
linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
Jethro Beekman <jethro@...tanix.com>,
andriy.shevchenko@...ux.intel.com, asapek@...gle.com, bp@...en8.de,
cedric.xing@...el.com, chenalexchen@...gle.com,
conradparker@...gle.com, cyhanish@...gle.com,
dave.hansen@...el.com, haitao.huang@...el.com,
josh@...htriplett.org, kai.huang@...el.com, kai.svahn@...el.com,
kmoy@...gle.com, ludloff@...gle.com, luto@...nel.org,
nhorman@...hat.com, npmccallum@...hat.com, puiterwijk@...hat.com,
rientjes@...gle.com, tglx@...utronix.de, yaozhangx@...gle.com
Subject: Re: [PATCH v34 10/24] mm: Add vm_ops->mprotect()
On Tue, Jul 07, 2020 at 06:01:50AM +0300, Jarkko Sakkinen wrote:
> +++ b/mm/mprotect.c
> @@ -603,13 +603,20 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
> goto out;
> }
>
> + tmp = vma->vm_end;
> + if (tmp > end)
> + tmp = end;
> +
> error = security_file_mprotect(vma, reqprot, prot);
> if (error)
> goto out;
>
> - tmp = vma->vm_end;
> - if (tmp > end)
> - tmp = end;
You don't need to move this any more, right?
> + if (vma->vm_ops && vma->vm_ops->mprotect) {
> + error = vma->vm_ops->mprotect(vma, nstart, tmp, prot);
> + if (error)
> + goto out;
> + }
> +
> error = mprotect_fixup(vma, &prev, nstart, tmp, newflags);
> if (error)
> goto out;
> --
> 2.25.1
>
Powered by blists - more mailing lists