On Thu, 2005-05-26 at 17:19 +0100, David Woodhouse wrote:
slab error in cache_free_debugcheck(): cache `size-32': double
free,
or memory outside object was overwritten
--- linux-2.6.9/kernel/auditfs.c~ 2005-05-26 12:50:13.000000000 +0100
+++ linux-2.6.9/kernel/auditfs.c 2005-05-26 17:28:19.000000000 +0100
@@ -168,18 +178,18 @@ static inline struct audit_watch *audit_
watch->perms = t->perms;
offset = sizeof(struct watch_transport);
- watch->filterkey = kmalloc(t->fklen, GFP_KERNEL);
+ watch->filterkey = kmalloc(t->fklen+1, GFP_KERNEL);
if (!watch->filterkey)
goto audit_to_watch_fail;
- watch->filterkey[0] = 0;
- strncat(watch->filterkey, memblk + offset, t->fklen);
+ watch->filterkey[t->fklen] = 0;
+ memcpy(watch->filterkey, memblk + offset, t->fklen);
offset += t->fklen;
- watch->path = kmalloc(t->pathlen, GFP_KERNEL);
+ watch->path = kmalloc(t->pathlen+1, GFP_KERNEL);
if (!watch->path)
goto audit_to_watch_fail;
- watch->path[0] = 0;
- strncat(watch->path, memblk + offset, t->pathlen);
+ watch->path[t->pathlen] = 0;
+ memcpy(watch->path, memblk + offset, t->pathlen);
goto audit_to_watch_exit;
--
dwmw2