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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <4786586B.76E4.0078.0@novell.com>
Date:	Thu, 10 Jan 2008 16:39:55 +0000
From:	"Jan Beulich" <jbeulich@...ell.com>
To:	<linux-kernel@...r.kernel.org>
Cc:	<James.Bottomley@...senPartnership.com>
Subject: [PATCH] adjust size calculation for get_vm_area() in ioremap()
	context

Short of getting a reply on the query why the argument of fls() here is
missing the decrement, here's a patch to add it (reducing the resulting
size when the incoming size is an exact power of two).

Signed-off-by: Jan Beulich <jbeulich@...ell.com>
Cc: James Bottomley <James.Bottomley@...senPartnership.com>
---

 mm/vmalloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.24-rc7/mm/vmalloc.c	2008-01-10 16:50:54.000000000 +0100
+++ 2.6.24-rc7-vm-ioremap-size/mm/vmalloc.c	2008-01-08 12:35:11.000000000 +0100
@@ -176,7 +176,7 @@ static struct vm_struct *__get_vm_area_n
 
 	BUG_ON(in_interrupt());
 	if (flags & VM_IOREMAP) {
-		int bit = fls(size);
+		int bit = fls(size - 1);
 
 		if (bit > IOREMAP_MAX_ORDER)
 			bit = IOREMAP_MAX_ORDER;



--
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