[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFA6WYPUEUVJqk9E2F6z9oBW3VpC+xeqqpY4YrU9KPL1s0DTyA@mail.gmail.com>
Date: Fri, 9 Aug 2019 11:06:24 +0530
From: Sumit Garg <sumit.garg@...aro.org>
To: Stuart Yoder <stuart.yoder@....com>
Cc: keyrings@...r.kernel.org, linux-integrity@...r.kernel.org,
linux-security-module@...r.kernel.org,
"tee-dev @ lists . linaro . org" <tee-dev@...ts.linaro.org>,
Daniel Thompson <daniel.thompson@...aro.org>,
Jonathan Corbet <corbet@....net>, jejb@...ux.ibm.com,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>,
Mimi Zohar <zohar@...ux.ibm.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
dhowells@...hat.com,
Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
Casey Schaufler <casey@...aufler-ca.com>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
"Serge E. Hallyn" <serge@...lyn.com>
Subject: Re: [Tee-dev] [RFC v2 2/6] tee: enable support to register kernel memory
On Fri, 9 Aug 2019 at 03:57, Stuart Yoder <stuart.yoder@....com> wrote:
>
>
>
> On 7/30/19 7:23 AM, Sumit Garg wrote:
>
> > @@ -264,7 +266,17 @@ struct tee_shm *tee_shm_register(struct tee_context *ctx, unsigned long addr,
> > goto err;
> > }
> >
> > - rc = get_user_pages_fast(start, num_pages, FOLL_WRITE, shm->pages);
> > + if (flags & TEE_SHM_USER_MAPPED) {
> > + rc = get_user_pages_fast(start, num_pages, FOLL_WRITE,
> > + shm->pages);
> > + } else {
> > + const struct kvec kiov = {
> > + .iov_base = (void *)start,
> > + .iov_len = PAGE_SIZE
> > + };
> > +
> > + rc = get_kernel_pages(&kiov, num_pages, 0, shm->pages);
>
> Passing a single kvec struct is temporary I assume? Because as currently
> written this will only work with num_pages==1.
>
Ah, thanks Stuart for pointing this out. It should rather be an array
of kvec struct. Will fix it in next version.
-Sumit
> Stuart
Powered by blists - more mailing lists