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>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 29 Dec 2006 19:15:56 -0800
From:	"Chen, Kenneth W" <kenneth.w.chen@...el.com>
To:	"'Andrew Morton'" <akpm@...l.org>, <zach.brown@...cle.com>
Cc:	<linux-aio@...ck.org>, <linux-kernel@...r.kernel.org>,
	"'Benjamin LaHaise'" <bcrl@...ck.org>, <suparna@...ibm.com>
Subject: [patch] aio: make aio_ring_info->nr_pages an unsigned int

The number of io_event in AIO event queue allowed currently is no more
than 2^32-1, because the syscall defines:

	asmlinkage long sys_io_setup(unsigned nr_events, aio_context_t __user *ctxp)

We internally allocate a ring buffer for nr_events and keeps tracks of
page descriptors for each of these ring buffer pages.  Since page size
is significantly larger than AIO event size (4096 versus 32), I don't
think it is ever possible to overflow nr_pages in 32-bit quantity.

This patch changes nr_pages to unsigned int. on 64-bit arch, changing
it to unsigned int also allows better packing of aio_ring_info structure.


Signed-off-by: Ken Chen <kenneth.w.chen@...el.com>

--- ./include/linux/aio.h.orig	2006-12-24 22:31:55.000000000 -0800
+++ ./include/linux/aio.h	2006-12-24 22:41:28.000000000 -0800
@@ -165,7 +165,7 @@ struct aio_ring_info {
 
 	struct page		**ring_pages;
 	spinlock_t		ring_lock;
-	long			nr_pages;
+	unsigned		nr_pages;
 
 	unsigned		nr, tail;
 
-
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