Tracing memory address access in kernel

Chriz Chow cmcvista at gmail.com
Tue Dec 4 08:23:34 EST 2018


Hello Pritam,

You may try moving or enlarging the bio_vec first, to see if the NULL is set due to memory corruption, or due to some other bugs.

Next, try to insmod one by one to locate it. Adding some printk() next to the suspicious memcpy() also helps.

I am also a newbie so I would also like to know if there’s any other good ways. :)

Chriz.

> El 4 dic 2018, a las 6:24 p. m., Pritam Bankar <pritambankar1988 at gmail.com> escribió:
> 
> Hello,
> 
> I am facing issue of memory corruption where only one field of
> allocated structure is getting corrupted. I have bio structure and one
> of the page in bio vector is getting set to NULL.
> 
> crash> struct bio_vec 0xffff88009dc5eb00
> 
> struct bio_vec {
>  bv_page = 0xffffea000a434b80,
>  bv_len = 4096,
>  bv_offset = 0
> }
> 
> crash> struct bio_vec 0xffff88009dc5eb10
> struct bio_vec {
>  bv_page = 0x0,
>  bv_len = 4096,
>  bv_offset = 0
> 
> }
> 
> crash> struct bio_vec 0xffff88009dc5eb20
> struct bio_vec {
>  bv_page = 0xffffea000a467500,
>  bv_len = 4096,
>  bv_offset = 0
> 
> }
> 
> I have allocated contagious memory for bio vectors. As you can see in
> second bio vector bv_page is getting set to NULL. This address is
> valid till the time I do some operations in my module. After some
> operations bv_page is getting set to NULL. Other fields are having
> valid data.
> 
> Is there any debugging technique / tool available which will track
> access to specific memory access?  I would like to dump stack every
> time bv_page is accessed or modified
> 
> Thanks and regards,
> Pritam Bankar
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



More information about the Kernelnewbies mailing list