Re: 2.6.7: preempt + sysfs = BUG on ppc

From: Andrew Morton
Date: Sun Jun 20 2004 - 16:52:39 EST


Tom Vier <tmv@xxxxxxxxxxx> wrote:
>
> i forgot to exclude /sys when i ran rsync. this is easily reproducable.
>
> kernel BUG in fill_read_buffer at fs/sysfs/file.c:92!

Please add this patch, then retest:

--- 25/fs/sysfs/file.c~sysfs-overflow-debug 2004-06-20 14:44:44.272707136 -0700
+++ 25-akpm/fs/sysfs/file.c 2004-06-20 14:48:23.580367304 -0700
@@ -5,6 +5,8 @@
#include <linux/module.h>
#include <linux/dnotify.h>
#include <linux/kobject.h>
+#include <linux/kallsyms.h>
+
#include <asm/uaccess.h>

#include "sysfs.h"
@@ -83,7 +85,13 @@ static int fill_read_buffer(struct file
return -ENOMEM;

count = ops->show(kobj,attr,buffer->page);
- BUG_ON(count > PAGE_SIZE);
+ if (count > PAGE_SIZE) {
+ printk("%s: show handler overrun\n", __FUNCTION__);
+ printk("->show handler: 0x%p", ops->show);
+ print_symbol(" (%s)", (unsigned long)ops->show);
+ printk("\n");
+ BUG();
+ }
if (count >= 0)
buffer->count = count;
else
_

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