mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
Merge "msm: adsprpc: Validate the CID"
This commit is contained in:
commit
b2e71fbdb8
1 changed files with 8 additions and 1 deletions
|
|
@ -118,6 +118,9 @@
|
|||
#define GET_TABLE_IDX_FROM_CTXID(ctxid) \
|
||||
((ctxid & FASTRPC_CTX_TABLE_IDX_MASK) >> FASTRPC_CTX_TABLE_IDX_POS)
|
||||
|
||||
#define VALID_FASTRPC_CID(cid) \
|
||||
(cid >= ADSP_DOMAIN_ID && cid < NUM_CHANNELS)
|
||||
|
||||
/* Reserve few entries in context table for critical kernel and static RPC
|
||||
* calls to avoid user invocations from exhausting all entries.
|
||||
*/
|
||||
|
|
@ -2066,7 +2069,11 @@ static int context_alloc(struct fastrpc_file *fl, uint32_t kernel,
|
|||
if (err)
|
||||
goto bail;
|
||||
}
|
||||
|
||||
VERIFY(err, VALID_FASTRPC_CID(cid));
|
||||
if (err) {
|
||||
err = -ECHRNG;
|
||||
goto bail;
|
||||
}
|
||||
chan = &me->channel[cid];
|
||||
|
||||
spin_lock_irqsave(&chan->ctxlock, irq_flags);
|
||||
|
|
|
|||
Loading…
Reference in a new issue