linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tee: optee: do not check memref size on return from Secure World
@ 2022-01-13 15:27 Jerome Forissier
  2022-01-18 12:05 ` Sumit Garg
  0 siblings, 1 reply; 3+ messages in thread
From: Jerome Forissier @ 2022-01-13 15:27 UTC (permalink / raw)
  To: Jens Wiklander, Sumit Garg, op-tee, linux-kernel; +Cc: Jerome Forissier

Commit c650b8dc7a79 ("tee: optee: do not check memref size on return
from Secure World") was mistakenly lost in commit 4602c5842f64 ("optee:
refactor driver with internal callbacks"). Remove the unwanted code
again.

Fixes: 4602c5842f64 ("optee: refactor driver with internal callbacks")
Signed-off-by: Jerome Forissier <jerome@forissier.org>
---
 drivers/tee/optee/smc_abi.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c
index cf2e3293567d..09e7ec673bb6 100644
--- a/drivers/tee/optee/smc_abi.c
+++ b/drivers/tee/optee/smc_abi.c
@@ -71,16 +71,6 @@ static int from_msg_param_tmp_mem(struct tee_param *p, u32 attr,
 	p->u.memref.shm_offs = mp->u.tmem.buf_ptr - pa;
 	p->u.memref.shm = shm;
 
-	/* Check that the memref is covered by the shm object */
-	if (p->u.memref.size) {
-		size_t o = p->u.memref.shm_offs +
-			   p->u.memref.size - 1;
-
-		rc = tee_shm_get_pa(shm, o, NULL);
-		if (rc)
-			return rc;
-	}
-
 	return 0;
 }
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tee: optee: do not check memref size on return from Secure World
  2022-01-13 15:27 [PATCH] tee: optee: do not check memref size on return from Secure World Jerome Forissier
@ 2022-01-18 12:05 ` Sumit Garg
  2022-01-19  7:32   ` Jens Wiklander
  0 siblings, 1 reply; 3+ messages in thread
From: Sumit Garg @ 2022-01-18 12:05 UTC (permalink / raw)
  To: Jerome Forissier; +Cc: Jens Wiklander, op-tee, linux-kernel

Hi Jerome,

On Thu, 13 Jan 2022 at 20:57, Jerome Forissier <jerome@forissier.org> wrote:
>
> Commit c650b8dc7a79 ("tee: optee: do not check memref size on return
> from Secure World") was mistakenly lost in commit 4602c5842f64 ("optee:
> refactor driver with internal callbacks"). Remove the unwanted code
> again.
>

Ah, that's unfortunate. The refactoring that OP-TEE driver has gone
through to support multiple ABIs (SMC and FF-A) was huge and I missed
it during review.

> Fixes: 4602c5842f64 ("optee: refactor driver with internal callbacks")
> Signed-off-by: Jerome Forissier <jerome@forissier.org>
> ---
>  drivers/tee/optee/smc_abi.c | 10 ----------
>  1 file changed, 10 deletions(-)
>

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>

-Sumit

> diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c
> index cf2e3293567d..09e7ec673bb6 100644
> --- a/drivers/tee/optee/smc_abi.c
> +++ b/drivers/tee/optee/smc_abi.c
> @@ -71,16 +71,6 @@ static int from_msg_param_tmp_mem(struct tee_param *p, u32 attr,
>         p->u.memref.shm_offs = mp->u.tmem.buf_ptr - pa;
>         p->u.memref.shm = shm;
>
> -       /* Check that the memref is covered by the shm object */
> -       if (p->u.memref.size) {
> -               size_t o = p->u.memref.shm_offs +
> -                          p->u.memref.size - 1;
> -
> -               rc = tee_shm_get_pa(shm, o, NULL);
> -               if (rc)
> -                       return rc;
> -       }
> -
>         return 0;
>  }
>
> --
> 2.32.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tee: optee: do not check memref size on return from Secure World
  2022-01-18 12:05 ` Sumit Garg
@ 2022-01-19  7:32   ` Jens Wiklander
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Wiklander @ 2022-01-19  7:32 UTC (permalink / raw)
  To: Sumit Garg; +Cc: Jerome Forissier, op-tee, linux-kernel

On Tue, Jan 18, 2022 at 1:05 PM Sumit Garg <sumit.garg@linaro.org> wrote:
>
> Hi Jerome,
>
> On Thu, 13 Jan 2022 at 20:57, Jerome Forissier <jerome@forissier.org> wrote:
> >
> > Commit c650b8dc7a79 ("tee: optee: do not check memref size on return
> > from Secure World") was mistakenly lost in commit 4602c5842f64 ("optee:
> > refactor driver with internal callbacks"). Remove the unwanted code
> > again.
> >
>
> Ah, that's unfortunate. The refactoring that OP-TEE driver has gone
> through to support multiple ABIs (SMC and FF-A) was huge and I missed
> it during review.
>
> > Fixes: 4602c5842f64 ("optee: refactor driver with internal callbacks")
> > Signed-off-by: Jerome Forissier <jerome@forissier.org>
> > ---
> >  drivers/tee/optee/smc_abi.c | 10 ----------
> >  1 file changed, 10 deletions(-)
> >
>
> Reviewed-by: Sumit Garg <sumit.garg@linaro.org>

I'm picking up this.

Thanks,
Jens

>
> -Sumit
>
> > diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c
> > index cf2e3293567d..09e7ec673bb6 100644
> > --- a/drivers/tee/optee/smc_abi.c
> > +++ b/drivers/tee/optee/smc_abi.c
> > @@ -71,16 +71,6 @@ static int from_msg_param_tmp_mem(struct tee_param *p, u32 attr,
> >         p->u.memref.shm_offs = mp->u.tmem.buf_ptr - pa;
> >         p->u.memref.shm = shm;
> >
> > -       /* Check that the memref is covered by the shm object */
> > -       if (p->u.memref.size) {
> > -               size_t o = p->u.memref.shm_offs +
> > -                          p->u.memref.size - 1;
> > -
> > -               rc = tee_shm_get_pa(shm, o, NULL);
> > -               if (rc)
> > -                       return rc;
> > -       }
> > -
> >         return 0;
> >  }
> >
> > --
> > 2.32.0
> >

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-19  7:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 15:27 [PATCH] tee: optee: do not check memref size on return from Secure World Jerome Forissier
2022-01-18 12:05 ` Sumit Garg
2022-01-19  7:32   ` Jens Wiklander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).