Received: by 10.223.176.46 with SMTP id f43csp3188398wra; Mon, 22 Jan 2018 09:47:27 -0800 (PST) X-Google-Smtp-Source: AH8x224rmwsaZaPJJy4a4B63MmuM24TEawQCfq8wpLDsV4yjtTD6UP3BPLcLvOzKKgIJgCJBXw81 X-Received: by 10.107.165.19 with SMTP id o19mr8687052ioe.87.1516643247603; Mon, 22 Jan 2018 09:47:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516643247; cv=none; d=google.com; s=arc-20160816; b=wvA1eMnPT3fyxJK5d7KBrBh+jnpYyeWGUyF4k92qbd1zEhPFOZEFkq4Ozx3DJU2gAs CJRBvsfKACc8DEn0M3/Zti/UEQneEJQ4esGMSoLVS0mn39kXDcHf1/pO1Du3Dj/hcGWR a5bvOQKJz/wp/i08ZG1IBeW53mc6spQLLMxmD3Y5oos/ApznshoBaah2fELxBaihhRTd boKH/UvHCr7k7RFnFGxQ2bM91IsQrHr6qZrFtjffiVO0rI3XxVzxYqNzEkVrOsgc/G2M JgFdf/Z1RjBVaM3tCz7r0ybk1r4df36OXZ/dLDcnEmUvwEn/4vJJ5R6lYveHD5M4MgXZ EjpA== 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=whojupztqoHouOhXljPtYBp1d3E0xuA/z1762WonjOU=; b=z2dIKXx+aOoCicsDJq3y1g0yCXyQ8USnjFbH+jmar7pTDxXL0SM/tW61/EQ5pS9Mwh 6G3FW16jG1MbPJgWITN+6ud8IBiBc2jwSGD+YN7ZWvC0VCq2ODFSMdLC9uIY/TZaV217 hD10/spt9TxSUH7ynFSIb3cZsUoEjgAE/9FWC5ZryK4SwVB3q6kQkaOVuI1fDRdCHAZ7 RHs+pnOuK+Bx2kFxilk7JObx/AZifGhZzRs9nhT92mTLeOKWOPN9jOfnett5h+2ah/Nr KmV9rINdjy6ZJtFK9rKmRn66xfmKgE+f9K5GqJldKfMDSxNh8sWCjF5uQz1lCwA5FbwB S39Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=QpwQDTS3; dkim=pass header.i=@codeaurora.org header.s=default header.b=MOM5ldM7; 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 o205si6264177itd.161.2018.01.22.09.47.14; Mon, 22 Jan 2018 09:47:27 -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=QpwQDTS3; dkim=pass header.i=@codeaurora.org header.s=default header.b=MOM5ldM7; 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 S1751240AbeAVRqr (ORCPT + 99 others); Mon, 22 Jan 2018 12:46:47 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:40294 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751040AbeAVRqo (ORCPT ); Mon, 22 Jan 2018 12:46:44 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7833B6021C; Mon, 22 Jan 2018 17:46:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516643203; bh=VmXgjIJjK6+Kh0TQzSEd6gO94luDWXrHPUZn1CD3PiM=; h=Date:From:To:cc:Subject:From; b=QpwQDTS3g9UhhsdN1H0GyxpGXb0h3JAK46zpW/nZk9xmsN0jWVZNc/cyZAkAZzQ+j XMeqAvnyO4997B89DSVoYSnv7scTsIe2dpfEbQn7FJXOQ6kV4VXX4aNzgQjZKGG1lZ VhntIwj3BU5tGC11+rGmu5myVT2ep2XqsQZ6Wo8o= 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 6274E6021C; Mon, 22 Jan 2018 17:46:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516643202; bh=VmXgjIJjK6+Kh0TQzSEd6gO94luDWXrHPUZn1CD3PiM=; h=Date:From:To:cc:Subject:From; b=MOM5ldM7YyikBlmvMIHRBdkskiVia0ZP42xPL8Jri+lZCfWwNhuadU7L/P6JrNVLg /EXnQj7U7h0DQIbf5d0zhpNOoP1kqcbM3D9yYsrBStILZ6zi/1ccWLN4DGDR5kPF5e 8tATgl2mp/FANRRJb+V2vpwUYfqgLtb2UZgVP/DU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6274E6021C 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: Mon, 22 Jan 2018 09:46:41 -0800 (PST) From: Liam Mark X-X-Sender: lmark@lmark-linux.qualcomm.com To: Laura Abbott , Sumit Semwal cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Dan Carpenter , Greg KH , linaro-mm-sig@lists.linaro.org Subject: [PATCH v2] 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 commit 204f672255c2 ("staging: android: ion: Use CMA APIs directly") the CMA API is now used directly and therefore the allocated memory is no longer automatically zeroed. Explicitly zero CMA allocated memory to ensure that no data is exposed to userspace. Fixes: 204f672255c2 ("staging: android: ion: Use CMA APIs directly") Signed-off-by: Liam Mark --- Changes in v2: - Clean up the commit message. - Add 'Fixes:' 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 86196ffd2faf..91a98785607a 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