lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHUa44HLULAZ3XXimqDzCfG8rc8OzU-ACmv2Gaee7Xbi=w3VEg@mail.gmail.com>
Date: Fri, 19 Sep 2025 09:58:46 +0200
From: Jens Wiklander <jens.wiklander@...aro.org>
To: Sumit Garg <sumit.garg@...nel.org>
Cc: Dan Carpenter <dan.carpenter@...aro.org>, 
	Amirreza Zarrabi <amirreza.zarrabi@....qualcomm.com>, linux-arm-msm@...r.kernel.org, 
	op-tee@...ts.trustedfirmware.org, linux-kernel@...r.kernel.org, 
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] tee: qcom: return -EFAULT instead of -EINVAL if
 copy_from_user() fails

On Fri, Sep 19, 2025 at 7:22 AM Sumit Garg <sumit.garg@...nel.org> wrote:
>
> On Thu, Sep 18, 2025 at 12:50:41PM +0300, Dan Carpenter wrote:
> > If copy_from_user() fails, the correct error code is -EFAULT, not
> > -EINVAL.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> > ---
> >  drivers/tee/qcomtee/core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Sumit Garg <sumit.garg@....qualcomm.com>

Applied.

/Jens

>
> -Sumit
>
> >
> > diff --git a/drivers/tee/qcomtee/core.c b/drivers/tee/qcomtee/core.c
> > index 783acc59cfa9..b6715ada7700 100644
> > --- a/drivers/tee/qcomtee/core.c
> > +++ b/drivers/tee/qcomtee/core.c
> > @@ -424,7 +424,7 @@ static int qcomtee_prepare_msg(struct qcomtee_object_invoke_ctx *oic,
> >               if (!(u[i].flags & QCOMTEE_ARG_FLAGS_UADDR))
> >                       memcpy(msgptr, u[i].b.addr, u[i].b.size);
> >               else if (copy_from_user(msgptr, u[i].b.uaddr, u[i].b.size))
> > -                     return -EINVAL;
> > +                     return -EFAULT;
> >
> >               offset += qcomtee_msg_offset_align(u[i].b.size);
> >               ib++;
> > --
> > 2.51.0
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ