Received: by 10.223.176.46 with SMTP id f43csp1422361wra; Fri, 19 Jan 2018 11:18:00 -0800 (PST) X-Google-Smtp-Source: ACJfBov/4UjTr/sJHtpZWWYDOmVqi/g8GhnX0GiFJlQ+cxCl75tb0JSho33T3c46a2avPcTGrDgA X-Received: by 10.98.217.135 with SMTP id b7mr38250893pfl.239.1516389480093; Fri, 19 Jan 2018 11:18:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516389480; cv=none; d=google.com; s=arc-20160816; b=Un2Tla/HWtTSRcK7Qc/DVD0hxRCD8ajnRrp8jrqYOUaKI9rVX/Jz2/lqUr8ghSLpBW 3dkq1NtDCi7noeAZ2QcdBbdYCcu7Q/LpYYK3ypdKQ1W/f7eBq8bQLivlNg216JKJfHUi RwQgHubn1kokkUYeaPn1zFoQWU6D8MECn1IdHCdUht2LJtnQ1N916jHabUUmiwIh03uB Vn9fD27WXWsl6S4qMRSEj45mvcZSNhc2SW4b97k8/wIsPQAoS//2qbdC0N49KbEvZ0Jd vRy9LLKPOBH5rpzYnwpNjWJtEEVCQ21mpRHlrUgBXBhjRexIQ1WZhSa1ryxp5nat2dhm I8gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=E1z6ynxoP+zIFqnoUGQbhCtKBLrLz2uFqmwOR+RXiMc=; b=c8LQ/zE8l2R+mLnNECbvMJJSmWySZ9MWzv4Kyhk2J3/Q1XMxrCKOUGmaMnWGZQHpYY 8ao8WD25iRPDpcMewcpuUVvxM6fsMRlggJr0nPoY0t3p0l9qLJiULl7e7lvO6cqIvkQh V6r8mvCmGFEc/8O5i2xqjKd6rPtTF0qW4m0mBXtD7hmMYLxZUw7wMPdGGJBcc0YkVV53 imtdBpLg+/ALuLNtXzpDdpwq0pZNZExvV3a5s41oMQf9y/Tg+TJsk3mZvrYoWz93gBGg c3wwcWxqXfCuZxfgOMW+A9Q5CF7peeVHLXwsb5p6bfZcpyvEt2EsRGDODG0i+8geyzd1 sAbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=DsJQE5g2; dkim=pass header.i=@codeaurora.org header.s=default header.b=DsJQE5g2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l13si8829568pgn.57.2018.01.19.11.17.45; Fri, 19 Jan 2018 11:18:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=DsJQE5g2; dkim=pass header.i=@codeaurora.org header.s=default header.b=DsJQE5g2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756307AbeASTQx (ORCPT + 99 others); Fri, 19 Jan 2018 14:16:53 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:38822 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755899AbeASTQt (ORCPT ); Fri, 19 Jan 2018 14:16:49 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id CA841601A1; Fri, 19 Jan 2018 19:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516389408; bh=s6Eutftd33K80GfMpYmAFhPvnDEbyg8MRAgO1XxuCbo=; h=Date:From:To:cc:Subject:From; b=DsJQE5g2tzpfRcfwHom8++pwqCwTYOpBLcvTIlW80aPiaryUN6glDodHpdexQvSwh hO9PJCR4vUu6X5LH+2EmxWzFn9N6+cWxNwhEozp6yrsM+CJ7rkMLaQvWPsjfVL7ixq pew8n2XN2sRHoOxfMIFAW00G+TzvBE2t+yzaNpr8= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from lmark-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lmark@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id EB58F601A1; Fri, 19 Jan 2018 19:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516389408; bh=s6Eutftd33K80GfMpYmAFhPvnDEbyg8MRAgO1XxuCbo=; h=Date:From:To:cc:Subject:From; b=DsJQE5g2tzpfRcfwHom8++pwqCwTYOpBLcvTIlW80aPiaryUN6glDodHpdexQvSwh hO9PJCR4vUu6X5LH+2EmxWzFn9N6+cWxNwhEozp6yrsM+CJ7rkMLaQvWPsjfVL7ixq pew8n2XN2sRHoOxfMIFAW00G+TzvBE2t+yzaNpr8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EB58F601A1 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=lmark@codeaurora.org Date: Fri, 19 Jan 2018 11:16:47 -0800 (PST) From: Liam Mark X-X-Sender: lmark@lmark-linux.qualcomm.com To: Laura Abbott , Sumit Semwal cc: linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH] staging: android: ion: Zero CMA allocated memory Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the CMA API is now used directly the allocated memory is no longer automatically zeroed. Explicitly zero CMA allocated memory to ensure that no data is exposed to userspace. Change-Id: I08e143707a0d31610821a7f16826c262bf3c1999 Signed-off-by: Liam Mark --- drivers/staging/android/ion/ion_cma_heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c index 86196ff..91a9878 100644 --- a/drivers/staging/android/ion/ion_cma_heap.c +++ b/drivers/staging/android/ion/ion_cma_heap.c @@ -51,6 +51,8 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer, if (!pages) return -ENOMEM; + memset(page_address(pages), 0, size); + table = kmalloc(sizeof(*table), GFP_KERNEL); if (!table) goto err; -- 1.8.5.2 Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project