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>
This commit is contained in:
Sathish Ambley 2016-05-19 14:43:25 -07:00 committed by Kyle Yan
parent 857cb953f0
commit 7099c2a6d2

View file

@ -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;