Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 276ab996 authored by Sathish Ambley's avatar Sathish Ambley
Browse files

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: default avatarBharath Kumar <bkumar@qti.qualcomm.com>
Signed-off-by: default avatarSathish Ambley <sathishambley@codeaurora.org>
parent 50239ba4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2272,6 +2272,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;