Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp381332rwi; Thu, 27 Oct 2022 02:33:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LzN/t05gDucuCGU6ehuevyZOlky2QyMO4KwoCTaG29oxvjXKmFvtKdzB/EWuQvy9jJDFt X-Received: by 2002:a63:2d8:0:b0:46e:9da4:df67 with SMTP id 207-20020a6302d8000000b0046e9da4df67mr31799785pgc.176.1666863187262; Thu, 27 Oct 2022 02:33:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666863187; cv=none; d=google.com; s=arc-20160816; b=C5cYbBCDUOrSl0JF09myd9bdMTPKktp7bglMAmNQd0/CYTEciNnkX+Ow/o+AhHUS1S qQZTMtu8tNgC2aJUWPKNV2kGirTLiT5UKnRgO1u9l+ubruLfvV/e9r6OseLxY2KTpqW/ QedJYLihHa32nPtC4p6cfTaCFTrGB9De1/Vf3a/aDEttpCErdcBctCOynZCJlI15cnaL 6Rp6tzp0eQCwQIGQ0PCAIBqbocopSdsHBY2hgupMijJ1ou2QC274cS1Jua10QePBwDZS beu97XhVtheGxoXn7++CGEsHkwTeCh+oCv75/KfzZeqdwxdfNv98dYdKKP6yNRsdHmPX 8bIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zjvxgKSD4vOaoaliZJ/fDQvs/0A14b1JxBkJ8uINWLA=; b=O2ygpDs9MEUbhynte5nt0/9jVUONAFgifg7+ot49BZH/tf1xTrPX54MCmFhvP0TDut hIdY6Jo9QPPRX1h51e8UKUgBKotX9w89kwxfr4HmxD6NrL7TYfa9MOmlyWuKMeryChH4 vXOB4RGmEtRgaYHZ+sOpisnvG4bztiA7fIqvnnsGD7PNyC/Xe01PP4/PB9r0KKKIQy26 jBVZim03o7hRfSyOYoh07iqcJBdA4XGCPlBXRCsIeVR3hOJL+Nb6+x3F2V4OVDuEfFbb O1Ufv8/2CeDj2IcNftfpPI1wYMqXFk05FCQk/LFQcG3g/Ji2AUnH9alaNMOoErfKvPsp yxmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qv4ysXdD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i26-20020a63221a000000b004525a153e80si986228pgi.445.2022.10.27.02.32.55; Thu, 27 Oct 2022 02:33:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qv4ysXdD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235249AbiJ0JLp (ORCPT + 99 others); Thu, 27 Oct 2022 05:11:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235280AbiJ0JKc (ORCPT ); Thu, 27 Oct 2022 05:10:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AE5D2D1FC for ; Thu, 27 Oct 2022 02:10:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5023762245 for ; Thu, 27 Oct 2022 09:10:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC741C4314E; Thu, 27 Oct 2022 09:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666861828; bh=c9GWqwITW/Ec76TO4vaKC32ouj33G3nwcnNIKBnDo1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qv4ysXdD0S4JZhKZhqSTXAwA5Sev2/KyXvDQUJZ6C/SU5cSiltZnb2XdI6vlKtY/9 A0RZi4gT0m/eN87JOITfz5kpsyuzvx0Yls/6Q/ruxJeTCizKZBDAyZWIpmFFhGjugB SVcQnqpEsi0cvNzSK+xf3R64hcWkAFVD759CUjBD8VZQscbb3sCfnAZioSRyX3V0e1 5NDX5WO+qh/2g1HIFOr6PUYt91Ojj8hU/zSB1y3YYvclr8QgoVaNaH0yrkFMtlGo9/ Pwvj0BKGQGZReCJxlP0K4syGd/Ht4E+NtnMKiOU+/jYbsQYY75C6yB6Llw3oKQKLVz gPbhxHIECE/4A== From: Oded Gabbay To: linux-kernel@vger.kernel.org Cc: farah kassabri Subject: [PATCH 12/15] habanalabs: zero ts registration buff when allocated Date: Thu, 27 Oct 2022 12:10:04 +0300 Message-Id: <20221027091007.664797-12-ogabbay@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221027091007.664797-1-ogabbay@kernel.org> References: <20221027091007.664797-1-ogabbay@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: farah kassabri 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 Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- 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 99b1d6ce26ae..541e1b6a2176 100644 --- a/drivers/misc/habanalabs/common/memory.c +++ b/drivers/misc/habanalabs/common/memory.c @@ -2109,7 +2109,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.25.1