From: Michal J. <mi...@ha...> - 2004-08-15 19:54:14
|
There is a problem with vmadump_common.c "recycling" kernel memory. In load_map it _does_ print a strange looking garbage in a case of a failure (leaving me scratching my head for quite a while :-). Here is a patch: --- bproc-4.0.0pre6/vmadump/vmadump_common.c~ 2004-06-22 12:24:20.000000000 -0600 +++ bproc-4.0.0pre6/vmadump/vmadump_common.c 2004-08-15 13:33:49.090716846 -0600 @@ -335,8 +335,8 @@ int vmadump_del_hook(struct vmadump_hook if (h->hook == hook) { list_del(&h->list); up_write(&hook_lock); - kfree(h); printk(KERN_INFO "vmadump: Unregistered hook \"%s\"\n", hook->tag); + kfree(h); return 0; } } @@ -544,8 +544,8 @@ int load_map(struct vmadump_map_ctx *ctx r = mmap_file(ctx, head, filename, PROT_READ|PROT_WRITE|PROT_EXEC, mmap_flags); if (r) { - kfree(filename); printk("vmadump: mmap failed: %s\n", filename); + kfree(filename); return r; } kfree(filename); The first chunk is not really needed but just in case if somebody would like later to add a printout of 'h' to this printk. :-) The second chunk is the real bug. A quick scan through the rest of bproc code does not show up similar troubles elsewhere but I was not very thorough. Michal |