Reputation: 33
Is there any way to determine whether a buffer received as a void* pointer comes from the stack or has been allocated with any other mechansim (vmalloc, kmalloc, ...)?
In other words, is there any API or trick, similar to is_vmalloc_addr, to know if the buffer comes from the stack?
Upvotes: 2
Views: 233
Reputation: 4024
See object_is_on_stack()
at include/linux/sched.h. Hope this helps.
Upvotes: 1