How to print kernel stack's lower and upper address in linux for process using pid and without using pid -


how print kernel stack's lower , upper address in linux each process process

  1. using pid ,
  2. without using pid

you may want understand current_stack_pointer() code. (for older kernels, stack size has been increased 16k)

the kernel stack starts on top of page , increases downwards, %esp on x86 points (or %rsp on x86_64) bottom of stack. can derive current macro follows

current macro == current_thread_info(%esp)->task current->pid == (current_thread_info(%esp)->task)->pid 

as know bottom of stack, need add/subtract number of pages top of kernel stack (using %esp or %rsp depends on arch).


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -