Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+3 -2
+1
drivers/tee/qcomtee/Kconfig
··· 2 2 # Qualcomm Trusted Execution Environment Configuration 3 3 config QCOMTEE 4 4 tristate "Qualcomm TEE Support" 5 + depends on ARCH_QCOM || COMPILE_TEST 5 6 depends on !CPU_BIG_ENDIAN 6 7 select QCOM_SCM 7 8 select QCOM_TZMEM_MODE_SHMBRIDGE
+1 -1
drivers/tee/qcomtee/call.c
··· 308 308 } 309 309 310 310 /* 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++) { 312 312 if (u[i].type == QCOMTEE_ARG_TYPE_OO || 313 313 u[i].type == QCOMTEE_ARG_TYPE_IO) 314 314 qcomtee_object_put(u[i].o);
+1 -1
drivers/tee/qcomtee/core.c
··· 424 424 if (!(u[i].flags & QCOMTEE_ARG_FLAGS_UADDR)) 425 425 memcpy(msgptr, u[i].b.addr, u[i].b.size); 426 426 else if (copy_from_user(msgptr, u[i].b.uaddr, u[i].b.size)) 427 - return -EINVAL; 427 + return -EFAULT; 428 428 429 429 offset += qcomtee_msg_offset_align(u[i].b.size); 430 430 ib++;