lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1516293427-17153-1-git-send-email-prime.zeng@hisilicon.com>
Date:   Fri, 19 Jan 2018 00:37:06 +0800
From:   Zeng Tao <prime.zeng@...ilicon.com>
To:     unlisted-recipients:; (no To-header on input)
CC:     <puck.chen@...ilicon.com>, Zeng Tao <prime.zeng@...ilicon.com>,
        "Laura Abbott" <labbott@...hat.com>,
        Sumit Semwal <sumit.semwal@...aro.org>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        Arve Hjønnevåg <arve@...roid.com>,
        Todd Kjos <tkjos@...roid.com>,
        Martijn Coenen <maco@...roid.com>,
        <devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH v2] ION: Sys_heap: fix the incorrect pool->gfp_mask setting

The gfp_mask low order pool is overlapped by the high order
inside the loop, so the gfp_mask of all pools are set to
high_order_gfp_flags. And all the allcations will have no __GFP_RECLAIM
flag, we will easily get the allocation failure problem with
memory presure.

Changes since v1:
1. fix the tag
2. change the flags define based on the comment.

Fixes: e7f63771b60e ("ION: Sys_heap: Add cached pool to spead up cached buffer alloc")
Signed-off-by: Zeng Tao <prime.zeng@...ilicon.com>
---
 drivers/staging/android/ion/ion_system_heap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index 4dc5d7a..12d0801 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -305,6 +305,8 @@ static int ion_system_heap_create_pools(struct ion_page_pool **pools,
 
 		if (orders[i] > 4)
 			gfp_flags = high_order_gfp_flags;
+		else
+			gfp_flags = low_order_gfp_flags;
 
 		pool = ion_page_pool_create(gfp_flags, orders[i], cached);
 		if (!pool)
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ