mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
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: d6e290837e ("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>
This commit is contained in:
parent
dcc7a571a3
commit
b14bb2e782
1 changed files with 1 additions and 1 deletions
|
|
@ -308,7 +308,7 @@ out_failed:
|
|||
}
|
||||
|
||||
/* Release any IO and OO objects not processed. */
|
||||
for (; u[i].type && i < num_params; i++) {
|
||||
for (; i < num_params && u[i].type; i++) {
|
||||
if (u[i].type == QCOMTEE_ARG_TYPE_OO ||
|
||||
u[i].type == QCOMTEE_ARG_TYPE_IO)
|
||||
qcomtee_object_put(u[i].o);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue