tree b95a3ebe7a0e2703c38636530313bcc1dfd96564
parent f23ef184b486ac021b6a471b4e94cfa04860d3b0
author Neil Horman <[EMAIL PROTECTED]> Wed, 07 Sep 2005 05:17:30 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Thu, 08 Sep 2005 06:57:30 -0700

[PATCH] Add missing overflow check in get_blkdev_list

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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

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

diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c
--- a/drivers/block/genhd.c
+++ b/drivers/block/genhd.c
@@ -45,7 +45,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");
        for (i = 0; i < ARRAY_SIZE(major_names); i++) {
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to