From mboxrd@z Thu Jan 1 00:00:00 1970 From: trent.tong@gmail.com (Xin Tong) Date: Mon, 28 Jul 2014 19:44:15 -0500 Subject: userspace stack start and end In-Reply-To: <874my2gmyh.fsf@gmail.com> References: <87bnsanoo0.fsf@gmail.com> <874my2gmyh.fsf@gmail.com> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org so the stack always starts at 0xc0000000 on x86 32bit and stack-start is pointing to the smaller address of stack ie growing downwards xin On Sunday, July 27, 2014, anupam kapoor wrote: > >>>>> [Sun, 27 Jul 2014 22:35:22 -0500]: "Xin Tong" (xin-tong): > > ,----[ xin-tong ] > | where is user:stack-segment-size defined ? > `---- > that is computable once again :) (assuming x86, and 1+3 split) > user:stack-segment-size = ((unsigned long)(0xc0000000 - > user:start-stack)) >> PAGE_SHIFT > > kind regards > anupam > > > ,----[ anupam ] > | ,----[ xin-tong ] > | | I am trying to find the start and end address of the userspace > | stack. > | | I see in the task_struct there is start_stack. But I could not > | find > | | end_start anywhere in the kernel code ? > | | > | | Can someone please tell me how to find the end of the stack ? > | > | `---- > | but that should be computable right e.g. > | user:stack-end = user:stack-start + user:stack-segment-size * > | number-of-pages > `---- > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140728/cb09c0a3/attachment.html