Skip to content

Commit 47039b5

Browse files
committed
Merge tag 'tee-amdtee-fix2-for-5.6' of https://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes
tee: amdtee: out of bounds read in find_session() * tag 'tee-amdtee-fix2-for-5.6' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: amdtee: out of bounds read in find_session() Link: https://lore.kernel.org/r/20200320063446.GA9892@jade Signed-off-by: Arnd Bergmann <[email protected]>
2 parents a88fead + 36fa3e5 commit 47039b5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/tee/amdtee/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ static struct amdtee_session *find_session(struct amdtee_context_data *ctxdata,
139139
u32 index = get_session_index(session);
140140
struct amdtee_session *sess;
141141

142+
if (index >= TEE_NUM_SESSIONS)
143+
return NULL;
144+
142145
list_for_each_entry(sess, &ctxdata->sess_list, list_node)
143146
if (ta_handle == sess->ta_handle &&
144147
test_bit(index, sess->sess_mask))

0 commit comments

Comments
 (0)