From: Neil Horman <nhorman@redhat.com>

Patch to clean up missing overflow check in get_blkdev_list.  The printf
which adds the "Block Devices" string in /proc/devices can overflow the
presented page if get_chrdev_list eats up the entire 4k space.

Signed-off-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/block/genhd.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/block/genhd.c~clean-up-missing-overflow-check-in-get_blkdev_list drivers/block/genhd.c
--- devel/drivers/block/genhd.c~clean-up-missing-overflow-check-in-get_blkdev_list	2005-08-21 23:48:36.000000000 -0700
+++ devel-akpm/drivers/block/genhd.c	2005-08-21 23:48:36.000000000 -0700
@@ -46,7 +46,7 @@ int get_blkdev_list(char *p, int used)
 	struct blk_major_name *n;
 	int i, len;
 
-	len = sprintf(p, "\nBlock devices:\n");
+	len = snprintf(p, (PAGE_SIZE-used), "\nBlock devices:\n");
 
 	down(&block_subsys_sem);
 	for (i = 0; i < ARRAY_SIZE(major_names); i++) {
_