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

Configure Feed

Select the types of activity you want to include in your feed.

tee: qcom: prevent potential off by one read

Re-order these checks to check if "i" is a valid array index before using
it. This prevents a potential off by one read access.

Fixes: d6e290837e50 ("tee: add Qualcomm TEE driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

authored by

Dan Carpenter and committed by
Jens Wiklander
b14bb2e7 dcc7a571

+1 -1
+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);