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>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 19 Aug 2016 17:45:18 +0530
From:   Pankaj Gupta <pagupta@...hat.com>
To:     linux-kernel@...r.kernel.org
Cc:     linux-mm@...ck.org, akpm@...ux-foundation.org, vbabka@...e.cz,
        mgorman@...hsingularity.net, riel@...hat.com, hannes@...xchg.org,
        iamjoonsoo.kim@....com, kirill.shutemov@...ux.intel.com,
        izumi.taku@...fujitsu.com
Subject: [PATCH] mm: Add WARN_ON for possibility of infinite loop if empty lists in free_pcppages_bulk'

While debugging issue in realtime kernel i found a scenario
which resulted in infinite loop resulting because of empty pcp->lists
and valid 'to_free' value. This patch is to add 'WARN_ON' in function
'free_pcppages_bulk' if there is possibility of infinite loop because 
of any bug in code.

Signed-off-by: Pankaj Gupta <pagupta@...hat.com>
---
 mm/page_alloc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3fbe73a..07d3080 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1096,6 +1096,8 @@ static void free_pcppages_bulk(struct zone *zone, int count,
 			if (++migratetype == MIGRATE_PCPTYPES)
 				migratetype = 0;
 			list = &pcp->lists[migratetype];
+
+			WARN_ON(batch_free > MIGRATE_PCPTYPES);
 		} while (list_empty(list));
 
 		/* This is the only non-empty list. Free them all. */
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ