event: Verify lcore is valid when registering poller
If we do not do a bounds check, this can run off the end of an array. Change-Id: I43cc4848fca7d68218e507db20e33823f8b550e4 Signed-off-by: Ziye Yang <ziye.yang@intel.com>
This commit is contained in:
parent
4b887a8cbc
commit
0c0582d3ce
@ -722,6 +722,12 @@ spdk_poller_register(struct spdk_poller **ppoller, spdk_poller_fn fn, void *arg,
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lcore >= RTE_MAX_LCORE) {
|
||||||
|
SPDK_ERRLOG("Attempted use lcore %u larger than max lcore %u\n",
|
||||||
|
lcore, RTE_MAX_LCORE - 1);
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
*ppoller = poller;
|
*ppoller = poller;
|
||||||
reactor = spdk_reactor_get(lcore);
|
reactor = spdk_reactor_get(lcore);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user