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]
Message-Id: <1197623337.3732.1.camel@sli10-desk.sh.intel.com>
Date:	Fri, 14 Dec 2007 17:08:57 +0800
From:	Shaohua Li <shaohua.li@...el.com>
To:	lkml <linux-kernel@...r.kernel.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>, mel <mel@....ul.ie>
Subject: [RFC]handle error of rmqueue_bulk

if rmqueue_bulk fails, we might get page with wrong migratetype,
shouldn't we consider the case? 

Thanks,
Shaohua

Index: linux/mm/page_alloc.c
===================================================================
--- linux.orig/mm/page_alloc.c	2007-12-14 16:44:35.000000000 +0800
+++ linux/mm/page_alloc.c	2007-12-14 16:45:42.000000000 +0800
@@ -1067,8 +1067,12 @@ again:
 
 		/* Allocate more to the pcp list if necessary */
 		if (unlikely(&page->lru == &pcp->list)) {
-			pcp->count += rmqueue_bulk(zone, 0,
+			int cn;
+			cn = rmqueue_bulk(zone, 0,
 					pcp->batch, &pcp->list, migratetype);
+			if (unlikely(!cn))
+				goto failed;
+			pcp->count += cn;
 			page = list_entry(pcp->list.next, struct page, lru);
 		}
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ