This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How is the definition of stack canary on MIPS arch?


On 08/30/2010 08:36 PM, Adam Jiang wrote:
On Mon, Aug 30, 2010 at 10:43:44AM -0700, David Daney wrote:
On 08/30/2010 09:46 AM, Richard Henderson wrote:
On 08/30/2010 03:45 AM, Adam Jiang wrote:
When I read the source in Linux kerne, it was said that stack canary for
implementing stack protector is defined as an offset to %gs on x86
architecture. How about stack canary defined on MIPS?

It's not implemented for MIPS.




For the Linux kernel, the MIPS stack canary would be a constant offset (that depends on PAGE_SIZE) from register $28.

David Daney

Thanks, David and Richard.


Is there code, doc or anything on this topic I can refer to? Is it
defined in gcc internally or in kernel source itself? Would you please
redirect me to the right place?


I am unaware of any documents. The MIPS Linux kernel ABI is not really documented anywhere, one learns it by studying and hacking on the source code.


32-bit kernels use a variant of the o32 ABI, 64-bit kernels use a variant of n64. Both dedicate register $28 as a pointer to the thread area of which the stack is a part.

The form any stack canary for the MIPS Linux kernel will be determined by whomever implements it.

I have done some research by googling. Here are what I've gotten.

http://www.trl.ibm.com/projects/security/ssp/main.html
http://www.trl.ibm.com/projects/security/ssp/
http://lxr.linux.no/linux+v2.6.35/arch/x86/include/asm/stackprotector.h

However, it seems there is no documents about how this is done on MIPS.
Do I miss something?


At RTH said, "It's not implemented for MIPS.", so there was really nothing to miss.


David Daney


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]