From 442045a32045bfb5890141cc1ff727a3a8101fef Mon Sep 17 00:00:00 2001 From: tinhnt86 Date: Thu, 8 Oct 2020 16:49:26 +0700 Subject: [PATCH] mcctrl_ikc_send: validate os and check input packet Change-Id: I1f8c2228043841685617b665eeeaf2ce15a08703 --- executer/kernel/mcctrl/ikc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/executer/kernel/mcctrl/ikc.c b/executer/kernel/mcctrl/ikc.c index 375e0314..9f453291 100644 --- a/executer/kernel/mcctrl/ikc.c +++ b/executer/kernel/mcctrl/ikc.c @@ -280,7 +280,11 @@ int mcctrl_ikc_send(ihk_os_t os, int cpu, struct ikc_scd_packet *pisp) { struct mcctrl_usrdata *usrdata; - if (!os || cpu < 0) { + if (!os || ihk_host_validate_os(os) || !pisp) { + return -EINVAL; + } + + if (cpu < 0) { return -EINVAL; }