msm: npu: memset npu_kevent to prevent leak stack information
npu_kevent will be copied to user buffer, so it is possible that
user will be able to access some stack memory via the uninitialized
padding data. This change is to use memset to make sure this stack
information won't be leaked.
Bug: 184564237
Change-Id: I77acafe11e67093f17906176720508674e1d35e8
Signed-off-by: Jilai Wang <jilaiw@codeaurora.org>
diff --git a/drivers/media/platform/msm/npu/npu_mgr.c b/drivers/media/platform/msm/npu/npu_mgr.c
index 44b68e3..4590a1f 100644
--- a/drivers/media/platform/msm/npu/npu_mgr.c
+++ b/drivers/media/platform/msm/npu/npu_mgr.c
@@ -725,6 +725,7 @@ static void app_msg_proc(struct npu_host_ctx *host_ctx, uint32_t *msg)
struct npu_kevent kevt;
struct npu_device *npu_dev = host_ctx->npu_dev;
+ memset(&kevt, 0, sizeof(kevt));
msg_id = msg[1];
switch (msg_id) {
case NPU_IPC_MSG_EXECUTE_DONE: