Skip to content

Commit 1d4e7d9

Browse files
committed
Merge tag 'tee-qcomtee-fixes-for-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into arm/fixes
TEE QTEE fixes for v6.18 - Adds ARCH_QCOM dependency for the QTEE driver - Fixing return values for copy_from_user() failures - Guarding against potential off by one read * tag 'tee-qcomtee-fixes-for-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee: tee: QCOMTEE should depend on ARCH_QCOM tee: qcom: return -EFAULT instead of -EINVAL if copy_from_user() fails tee: qcom: prevent potential off by one read
2 parents 3a86608 + 3b63efa commit 1d4e7d9

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/tee/qcomtee/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Qualcomm Trusted Execution Environment Configuration
33
config QCOMTEE
44
tristate "Qualcomm TEE Support"
5+
depends on ARCH_QCOM || COMPILE_TEST
56
depends on !CPU_BIG_ENDIAN
67
select QCOM_SCM
78
select QCOM_TZMEM_MODE_SHMBRIDGE

drivers/tee/qcomtee/call.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static int qcomtee_params_from_args(struct tee_param *params,
308308
}
309309

310310
/* Release any IO and OO objects not processed. */
311-
for (; u[i].type && i < num_params; i++) {
311+
for (; i < num_params && u[i].type; i++) {
312312
if (u[i].type == QCOMTEE_ARG_TYPE_OO ||
313313
u[i].type == QCOMTEE_ARG_TYPE_IO)
314314
qcomtee_object_put(u[i].o);

drivers/tee/qcomtee/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ static int qcomtee_prepare_msg(struct qcomtee_object_invoke_ctx *oic,
424424
if (!(u[i].flags & QCOMTEE_ARG_FLAGS_UADDR))
425425
memcpy(msgptr, u[i].b.addr, u[i].b.size);
426426
else if (copy_from_user(msgptr, u[i].b.uaddr, u[i].b.size))
427-
return -EINVAL;
427+
return -EFAULT;
428428

429429
offset += qcomtee_msg_offset_align(u[i].b.size);
430430
ib++;

0 commit comments

Comments
 (0)