summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSathish Ambley <sathishambley@codeaurora.org>2016-05-19 14:43:25 -0700
committerKyle Yan <kyan@codeaurora.org>2016-05-31 15:28:19 -0700
commit7099c2a6d2f6c68016bfdb2c62eefa49885b569c (patch)
tree70b97a044d5b7bab2fbbf712ade8eba131da313e
parent857cb953f008186eefe7aa66a6ed3cd5722422f4 (diff)
msm: ADSPRPC: Validate the SMMU session count
Make sure that the session count does not exceed the maximum sessions to avoid buffer overflow. Change-Id: I1a9830a6f859d7d525247d27d0a143997998d997 Acked-by: Bharath Kumar <bkumar@qti.qualcomm.com> Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
-rw-r--r--drivers/char/adsprpc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c
index cbdda065c404..e4fafb01ca17 100644
--- a/drivers/char/adsprpc.c
+++ b/drivers/char/adsprpc.c
@@ -2305,6 +2305,9 @@ static int fastrpc_cb_legacy_probe(struct device *dev)
if (err)
goto bail;
for (i = 0; i < sids_size/sizeof(unsigned int); i++) {
+ VERIFY(err, chan->sesscount < NUM_SESSIONS);
+ if (err)
+ goto bail;
sess = &chan->session[chan->sesscount];
sess->smmu.cb = sids[i];
sess->dev = first_sess->dev;