Re: linked list within a kernel probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

>
> static __u8 _kprobe_setup_cache_elements( struct kprobe_head *pHead,
> __u16 elements, __u32 size)
> {

>      struct list_head local_head;
>
>      INIT_LIST_HEAD(&local_head);
>

>          pHead->p_mem_cache = &local_head;

> }

 

just from a quick look at this code, my guess is that you should not be using stack addresses in your list.

Your local_head is on the stack, therefore it gets corrupted after you exit your function and invoke other functions.

Did you really mean to store a pointer to local_head, or was your intention to point to the first element on local_head?

 

 

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux