I’m troubleshooting some Linux kernel code, and it would be nice to know where the memory pointer allocation originated.
Question: Are there Linux kernel macros available like ADDR_IS_STACK_ADDR(ptr)
or ADDR_IS_HEAP_ADDR(ptr)
so I can check where an addr might have come from? If so, please point me in the right direction
In my case I just want to know if it is from a stack variable passed by reference… but it might be nice to know if there are macros to check:
- is the address from the stack?
- is the address from the kmalloc?
- is the address from the vmalloc?
- from .text , like a function pointer?
- other classifications?