All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	linux-arm-msm@vger.kernel.org, op-tee@lists.trustedfirmware.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] tee: qcom: return -EFAULT instead of -EINVAL if copy_from_user() fails
Date: Fri, 19 Sep 2025 10:51:56 +0530	[thread overview]
Message-ID: <aMzodGIvL88HNi0d@sumit-X1> (raw)
In-Reply-To: <aMvV8WIKnqLN3w6R@stanley.mountain>

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@linaro.org>
> ---
>  drivers/tee/qcomtee/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>

-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
> 

WARNING: multiple messages have this Message-ID (diff)
From: Sumit Garg via OP-TEE <op-tee@lists.trustedfirmware.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>,
	linux-arm-msm@vger.kernel.org, op-tee@lists.trustedfirmware.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] tee: qcom: return -EFAULT instead of -EINVAL if copy_from_user() fails
Date: Fri, 19 Sep 2025 10:51:56 +0530	[thread overview]
Message-ID: <aMzodGIvL88HNi0d@sumit-X1> (raw)
In-Reply-To: <aMvV8WIKnqLN3w6R@stanley.mountain>

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@linaro.org>
> ---
>  drivers/tee/qcomtee/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>

-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
> 

  reply	other threads:[~2025-09-19  5:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18  9:50 [PATCH] tee: qcom: return -EFAULT instead of -EINVAL if copy_from_user() fails Dan Carpenter
2025-09-18  9:50 ` Dan Carpenter
2025-09-19  5:21 ` Sumit Garg [this message]
2025-09-19  5:21   ` Sumit Garg via OP-TEE
2025-09-19  7:58   ` Jens Wiklander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aMzodGIvL88HNi0d@sumit-X1 \
    --to=sumit.garg@kernel.org \
    --cc=amirreza.zarrabi@oss.qualcomm.com \
    --cc=dan.carpenter@linaro.org \
    --cc=jens.wiklander@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=op-tee@lists.trustedfirmware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.