[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YHVAKeYh04y5w7ia@hirez.programming.kicks-ass.net>
Date: Tue, 13 Apr 2021 08:54:33 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Kees Cook <keescook@...omium.org>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
boris.ostrovsky@...cle.com, jgross@...e.com,
sstabellini@...nel.org, x86@...nel.org,
jani.nikula@...ux.intel.com, joonas.lahtinen@...ux.intel.com,
rodrigo.vivi@...el.com, chris@...is-wilson.co.uk,
intel-gfx@...ts.freedesktop.org, linux-mm@...ck.org, hch@....de
Subject: Re: [PATCH 6/7] i915: Convert to verify_page_range()
On Mon, Apr 12, 2021 at 01:08:38PM -0700, Kees Cook wrote:
> On Mon, Apr 12, 2021 at 10:00:18AM +0200, Peter Zijlstra wrote:
> > @@ -1249,14 +1249,14 @@ static int check_absent_pte(pte_t *pte,
> >
> > static int check_present(unsigned long addr, unsigned long len)
> > {
> > - return apply_to_page_range(current->mm, addr, len,
> > - check_present_pte, (void *)addr);
> > + return verify_page_range(current->mm, addr, len,
> > + check_present_pte, (void *)addr);
>
> For example, switch to returning bad addr through verify_page_range(),
> or have a by-reference value, etc:
>
> unsigned long failed;
>
> failed = verify_page_range(current->mm< addr, len, check_present_pte);
> if (failed) {
> pr_err("missing PTE:%lx\n",
> (addr - failed) >> PAGE_SHIFT);
OK, lemme try that.
Powered by blists - more mailing lists