[PATCH] hang on /dev/kmem

From: Hugh Dickins (hugh@veritas.com)
Date: Fri Jul 27 2001 - 16:14:08 EST


read_kmem() gets stuck in silly loop after reading last vmalloc area.
Patch below against 2.4.8-pre1 or 2.4.7-ac1: please apply.

Hugh

--- linux-2.4.8-pre1/drivers/char/mem.c Wed Jul 11 00:07:46 2001
+++ linux/drivers/char/mem.c Fri Jul 27 21:40:05 2001
@@ -260,7 +260,9 @@
                         if (len > PAGE_SIZE)
                                 len = PAGE_SIZE;
                         len = vread(kbuf, (char *)p, len);
- if (len && copy_to_user(buf, kbuf, len)) {
+ if (!len)
+ break;
+ if (copy_to_user(buf, kbuf, len)) {
                                 free_page((unsigned long)kbuf);
                                 return -EFAULT;
                         }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:35 EST