From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-1457137-1516789178-2-3060563073938073994 X-Sieve: CMU Sieve 3.0 X-Spam-known-sender: no ("Email failed DMARC policy for domain") X-Spam-score: 0.0 X-Spam-hits: BAYES_00 -1.9, HEADER_FROM_DIFFERENT_DOMAINS 0.25, RCVD_IN_DNSWL_MED -2.3, SPF_PASS -0.001, LANGUAGES en, BAYES_USED global, SA_VERSION 3.4.0 X-Spam-source: IP='140.211.166.137', Host='smtp4.osuosl.org', Country='US', FromHeader='com', MailFrom='org' X-Spam-charsets: plain='us-ascii' X-IgnoreVacation: yes ("Email failed DMARC policy for domain") X-Resolved-to: greg@kroah.com X-Delivered-to: greg@kroah.com X-Mail-from: driverdev-devel-bounces@linuxdriverproject.org ARC-Seal: i=1; a=rsa-sha256; cv=none; d=messagingengine.com; s=arctest; t=1516789177; b=N6qFIE+XsOgZLaBxQ2QHqQkaj44fB9Ui97umVpc7KpnQaFZ zVM6EvxM1AHBzstgFWkeuBIZcafcM99PDhjfJI6Efd9DPH1hcdN4H+Tnnsg8wjcC 1uTEWeovETrZOpZ/vfOBufloAmFCYfJWJn0WBgHIJ5/lS4ex6vrdJv/JuhV2iu0k Ec/v9yQZa8G7WtlIweXqaFuCvWUBUTLfszgBHI190j5TyTm2O8oF2Z0/ewYyVNtT lfjhlfdvZKQMbnezl/hsuYQ2RvUfC6QKZsoc7rrucE6gUYst8VVhhk86lsjnvbA9 Qqd5NPPubRgQP63oYhKD4Ukour/8/Jqzb02OROA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=subject:to:references:from:message-id :date:mime-version:in-reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc :content-transfer-encoding:content-type:sender; s=arctest; t= 1516789177; bh=UksINXMM1vYJXi+2ByuQvygpgiYWwArckMLbMmb+yng=; b=h S620z33jsJpbeM9sPI058rW3dv/N1VfJuVXJtALePCTk5qmZOVmV6UanQo1UjVve G5CelQJBO3/xgchiJXujgEbZIojfSufhunfjecv7fPZpg9vRjyCyfqfUr9o5dztC /O0bNg6lYoJblvgjEs+tXpN1VEjLbalESZn5rTrwNu3dfxtOQzjDITigbsiZzzgv 2NTd7dX4p0QdIMFUgdR66m05cpup/yzq7PqLcq0XbLQb6UhBcPbVs0huSmn5aTx6 yvwpWztSEw2bL2nyJUPbzHmCCfNdZoTrxAz/+G7SFAOR4j2TO8eL83/d7eQ9HEm9 7zwwPz9TdkPGOD46cOdhw== ARC-Authentication-Results: i=1; mx2.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=fail (p=none,has-list-id=yes,d=none) header.from=redhat.com; iprev=pass policy.iprev=140.211.166.137 (smtp4.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=fraxinus.osuosl.org; x-aligned-from=fail; x-google-dkim=fail (message has been altered; 2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=EwhUoP1B; x-ptr=fail x-ptr-helo=fraxinus.osuosl.org x-ptr-lookup=smtp4.osuosl.org; x-return-mx=pass smtp.domain=linuxdriverproject.org smtp.result=pass smtp_is_org_domain=yes header.domain=redhat.com header.result=pass header_is_org_domain=yes; x-tls=pass version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128 Authentication-Results: mx2.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=fail (p=none,has-list-id=yes,d=none) header.from=redhat.com; iprev=pass policy.iprev=140.211.166.137 (smtp4.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=fraxinus.osuosl.org; x-aligned-from=fail; x-google-dkim=fail (message has been altered; 2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=EwhUoP1B; x-ptr=fail x-ptr-helo=fraxinus.osuosl.org x-ptr-lookup=smtp4.osuosl.org; x-return-mx=pass smtp.domain=linuxdriverproject.org smtp.result=pass smtp_is_org_domain=yes header.domain=redhat.com header.result=pass header_is_org_domain=yes; x-tls=pass version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128 X-Remote-Delivered-To: driverdev-devel@osuosl.org X-Google-Smtp-Source: AH8x226rvab4ZqQZHBq7gJKwsZVU81XMc7XUdVdwc9ngHj7vdoCn4k/qXkTU1gew+JurPrcrrnILlw== Subject: Re: [PATCH v2] staging: android: ion: Zero CMA allocated memory To: Liam Mark , Sumit Semwal References: From: Laura Abbott Message-ID: Date: Wed, 24 Jan 2018 02:19:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.24 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Greg KH , linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, Dan Carpenter Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" X-getmail-retrieved-from-mailbox: INBOX X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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, Laura > table = kmalloc(sizeof(*table), GFP_KERNEL); > if (!table) > goto err; > _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel