Sujet : Constant Stack Canaries
De : robfi680 (at) *nospam* gmail.com (Robert Finch)
Groupes : comp.archDate : 30. Mar 2025, 13:16:52
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsbcnl$1d4m5$1@dont-email.me>
User-Agent : Mozilla Thunderbird
Just got to thinking about stack canaries. I was going to have a special purpose register holding the canary value for testing while the program was running. But I just realized today that it may not be needed. Canary values could be handled by the program loader as constants, eliminating the need for a register. Since the value is not changing while the program is running, it could easily be a constant. This may require a fixup record handled by the assembler / linker to indicate to the loader to place a canary value.
Prolog code would just store an immediate to the stack. On return a TRAP instruction could check for the immediate value and trap if not present.
But the process seems to require assembler / linker support.