Received: by 10.223.176.46 with SMTP id f43csp1423853wra; Wed, 24 Jan 2018 16:41:35 -0800 (PST) X-Google-Smtp-Source: AH8x2274K4H/iFGXO5ooF+gQmpFz9Bs0HZm6+OVuJOd0pMLZHCoXxorRu//8zgKCL6rR10DHbj15 X-Received: by 10.101.101.68 with SMTP id a4mr11822114pgw.368.1516840895213; Wed, 24 Jan 2018 16:41:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516840895; cv=none; d=google.com; s=arc-20160816; b=j4LNbhbXqCCSPC72jxsoruvmncmSmzdyEI+5e3JNPhFNQesm6Hn0o5oOXN7eertzEJ NPYnNCaRjCn2oZArdhulxa6Q93PAetXc5RZ3S3LpCn6NolmMJfeSkuMSTYxymwkvaFiE PfE9hhEQJp7xopC6M4mjqeXdPlb+JiJpULqnBeIEElljMdx63YOi+F1bGTNl0JTKmdws JSdpO8+dFK3ct/4deyNjnSg+81/hdsBEKSV6/FC38OpBDTYnCgfZ4qci41D41HaXY3wA XWFXGNmKK6UaQ9b39rf7ezjG6HrnTdIFa1okJgDMgeAOhIiJPnTnlUI01YWHH7NFzXkU +uIw== 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:references :message-id:in-reply-to:subject:cc:to:from:date:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=Ef9jocBxG1QAT7Wc5iPwA48R6I0pmW3Yd01Q+hS6Yow=; b=BxxKIz0Y+02IG48912rOqhngWm9ptp1Rpep2YTbUJiQyIG49AG9FVD0MnKPyCEB/Yp x/SCy2euUMHrfFJDUDe3STfnyWk6/kJ2Ne9ibBlK4tNSNXrsMfHjzOpDeW2G5wVjhpph AVzBnMlYJAWLsviksUg3qVBoB7u4IfnjA3ySQ+iDpaMyKC3/vL6OgWtV7aPsTVYkypvI MGMp9r85ICkkHA98f3u7Rrz2/PRZ/JfZa94CMiE/FFZsSXVibZNeC2311/AsvdqJKI0A HsE4EwD3GUOugPuygY65cL/tjKyV9Iukmo6TZR5x4B+rehE+h5ZC7A4atCaK3IS30kjB CyZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=TLhZUUS9; dkim=pass header.i=@codeaurora.org header.s=default header.b=TLhZUUS9; 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 p1si790976pge.487.2018.01.24.16.41.20; Wed, 24 Jan 2018 16:41:35 -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=TLhZUUS9; dkim=pass header.i=@codeaurora.org header.s=default header.b=TLhZUUS9; 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 S933019AbeAYAka (ORCPT + 99 others); Wed, 24 Jan 2018 19:40:30 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:38012 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932250AbeAYAk3 (ORCPT ); Wed, 24 Jan 2018 19:40:29 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E030B6074E; Thu, 25 Jan 2018 00:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516840828; bh=A05JwGBH5Bb8IohImNTryfX1PU5J7/t+V7d/Ju2s2hs=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=TLhZUUS91y/lc/pNvHGjZ410LeYXQA+7p/tOHCVZlg1Js8vCsVA/eRVffXiUCuaA7 MU9AlOh+gUnLxI9pNV3HZgfQm0vgF545odbl47ROeZM9fsuL1NZu/625yJRWkg6a44 WGSrA5KSyaSrqT0ytM9YFofTmw6gxfjPJaxF5aIA= 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 B6FF66074E; Thu, 25 Jan 2018 00:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516840828; bh=A05JwGBH5Bb8IohImNTryfX1PU5J7/t+V7d/Ju2s2hs=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=TLhZUUS91y/lc/pNvHGjZ410LeYXQA+7p/tOHCVZlg1Js8vCsVA/eRVffXiUCuaA7 MU9AlOh+gUnLxI9pNV3HZgfQm0vgF545odbl47ROeZM9fsuL1NZu/625yJRWkg6a44 WGSrA5KSyaSrqT0ytM9YFofTmw6gxfjPJaxF5aIA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B6FF66074E 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: Wed, 24 Jan 2018 16:40:27 -0800 (PST) From: Liam Mark X-X-Sender: lmark@lmark-linux.qualcomm.com To: Laura Abbott cc: Sumit Semwal , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Dan Carpenter , Greg KH , linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH v2] staging: android: ion: Zero CMA allocated memory In-Reply-To: Message-ID: References: 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 On Wed, 24 Jan 2018, Laura Abbott wrote: > On 01/22/2018 09:46 AM, Liam Mark wrote: > > 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); > > + > > This won't work for highmem pages. You need to zero by page via > kmap_atomic in that case. You can use PageHighMem to separate the > paths. Thanks for catching that, I will update the patch. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project