This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [WIP] uprobe tests


On Sat, 2007-06-09 at 15:55 -0700, Jim Keniston wrote:
> On Sat, 2007-06-09 at 17:01 -0400, Frank Ch. Eigler wrote:
> > Srikar Dronamraju <srikar@linux.vnet.ibm.com> writes:
> > 
...
> > 
> > When I run this test suite on i686 2.6.21-rc6-mm1 + may25-uprobes
> > kernel configured with a bunch of debugging options, we get a bunch of
> > kernel errors.  A sampling:
> 
...
> 
> Most of these problems appear to be associated with the test harness
> (which includes u_dbfs_cleanup), but there's one associated with
> register_uprobe().
...
> > 
> > slab error in verify_redzone_free(): cache `size-32': memory outside object was 
> > overwritten
> >  [<c04787f2>] cache_free_debugcheck+0xb2/0x1a6
> >  [<c0478b5e>] kfree+0x90/0xe0
> >  [<f098208b>] u_dbfs_cleanup+0x4b/0x4d [blink2]
> >  [<f09820d6>] cleanup_module+0x49/0x4b [blink2]
...

I rebuilt kernels with Frank's debugging options enabled.  Here's a
simple fix that yields clean test runs for me.  In the test suite, in
include/udbgfs.c, in the line
	print_buf = kmalloc(sizeof(print_buf),GFP_KERNEL);
change
	sizeof(print_buf)
to
	sizeof(*print_buf)

BTW, I don't think test_printk() handles buffer overflows correctly.
When we reach the end of the buffer, it's possible for vsnprintf() to
return a number greater than print_buf->bytes_left (see "Return value"
in the man page), which means print_buf->bytes_left can underflow to a
very big number, telling the next call to vsnprintf() that we have a
very big buffer.  I don't see any overflows in the test suite that would
test my hypothesis, though, so I'll leave that investigation and fix to
Srikar.

> > 
> > 
> > - FChE

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]