提交 f62c6d0a 编写于 作者: N Neil Horman 提交者: Linus Torvalds

[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: NNeil Horman <nhorman@redhat.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 f23ef184
......@@ -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");
down(&block_subsys_sem);
for (i = 0; i < ARRAY_SIZE(major_names); i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册