diff options
author | Neil Horman <nhorman@redhat.com> | 2005-09-06 18:17:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:30 -0400 |
commit | f62c6d0a2607b2d1fdf280d4d1467a7a6e24c67d (patch) | |
tree | b95a3ebe7a0e2703c38636530313bcc1dfd96564 /drivers/block/genhd.c | |
parent | f23ef184b486ac021b6a471b4e94cfa04860d3b0 (diff) |
[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 <nhorman@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block/genhd.c')
-rw-r--r-- | drivers/block/genhd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c index 47fd3659a061..d42840cc0d1d 100644 --- a/drivers/block/genhd.c +++ b/drivers/block/genhd.c | |||
@@ -45,7 +45,7 @@ int get_blkdev_list(char *p, int used) | |||
45 | struct blk_major_name *n; | 45 | struct blk_major_name *n; |
46 | int i, len; | 46 | int i, len; |
47 | 47 | ||
48 | len = sprintf(p, "\nBlock devices:\n"); | 48 | len = snprintf(p, (PAGE_SIZE-used), "\nBlock devices:\n"); |
49 | 49 | ||
50 | down(&block_subsys_sem); | 50 | down(&block_subsys_sem); |
51 | for (i = 0; i < ARRAY_SIZE(major_names); i++) { | 51 | for (i = 0; i < ARRAY_SIZE(major_names); i++) { |