Commit 0c0582d3 authored by Ziye Yang's avatar Ziye Yang Committed by Daniel Verkamp
Browse files

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: default avatarZiye Yang <ziye.yang@intel.com>
parent 4b887a8c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -722,6 +722,12 @@ spdk_poller_register(struct spdk_poller **ppoller, spdk_poller_fn fn, void *arg,
		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;
	reactor = spdk_reactor_get(lcore);