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: <alpine.DEB.2.00.0904261255520.18988@chino.kir.corp.google.com>
Date:	Sun, 26 Apr 2009 12:56:31 -0700 (PDT)
From:	David Rientjes <rientjes@...gle.com>
To:	Pekka Enberg <penberg@...helsinki.fi>
cc:	Nick Piggin <npiggin@...e.de>, linux-kernel@...r.kernel.org
Subject: [patch] slqb: enforce MAX_ORDER

Slabs may not be allocated at MAX_ORDER or higher.

Cc: Nick Piggin <npiggin@...e.de>
Signed-off-by: David Rientjes <rientjes@...gle.com>
---
 mm/slqb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/slqb.c b/mm/slqb.c
--- a/mm/slqb.c
+++ b/mm/slqb.c
@@ -872,6 +872,7 @@ __setup("slqb_debug", setup_slqb_debug);
 static int __init setup_slqb_min_order(char *str)
 {
 	get_option(&str, &slqb_min_order);
+	slqb_min_order = min(slqb_min_order, MAX_ORDER - 1);
 
 	return 1;
 }
@@ -1840,8 +1841,8 @@ static int calculate_order(int size)
 	 * This size cannot fit in order-1. Allow bigger orders, but
 	 * forget about trying to save space.
 	 */
-	order = slab_order(size, MAX_ORDER, 0);
-	if (order <= MAX_ORDER)
+	order = slab_order(size, MAX_ORDER - 1, 0);
+	if (order < MAX_ORDER)
 		return order;
 
 	return -ENOSYS;
--
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