[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221224013034.392810-10-sashal@kernel.org>
Date: Fri, 23 Dec 2022 20:30:26 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: farah kassabri <fkassabri@...ana.ai>,
Oded Gabbay <ogabbay@...nel.org>,
Sasha Levin <sashal@...nel.org>, gregkh@...uxfoundation.org,
osharabi@...ana.ai, ynudelman@...ana.ai, ttayar@...ana.ai,
dhirschfeld@...ana.ai
Subject: [PATCH AUTOSEL 6.0 10/18] habanalabs: zero ts registration buff when allocated
From: farah kassabri <fkassabri@...ana.ai>
[ Upstream commit 679e968908a4997d02c2a7df294e97b066f9149f ]
To avoid memory corruption in kernel memory while using timestamp
registration nodes, zero the kernel buff memory when its allocated.
Signed-off-by: farah kassabri <fkassabri@...ana.ai>
Reviewed-by: Oded Gabbay <ogabbay@...nel.org>
Signed-off-by: Oded Gabbay <ogabbay@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/misc/habanalabs/common/memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c
index 61bc1bfe984a..751f8c751b72 100644
--- a/drivers/misc/habanalabs/common/memory.c
+++ b/drivers/misc/habanalabs/common/memory.c
@@ -2097,7 +2097,7 @@ static int hl_ts_alloc_buf(struct hl_mmap_mem_buf *buf, gfp_t gfp, void *args)
/* Allocate the internal kernel buffer */
size = num_elements * sizeof(struct hl_user_pending_interrupt);
- p = vmalloc(size);
+ p = vzalloc(size);
if (!p)
goto free_user_buff;
--
2.35.1
Powered by blists - more mailing lists