Deutsch   English   Français   Italiano  
<vsbcnl$1d4m5$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Robert Finch <robfi680@gmail.com>
Newsgroups: comp.arch
Subject: Constant Stack Canaries
Date: Sun, 30 Mar 2025 08:16:52 -0400
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <vsbcnl$1d4m5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 30 Mar 2025 14:16:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="478e67d4b018ca3c18186a69067ddb6a";
	logging-data="1479365"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+QIoOoOd2wczDjCmmu6MJp/fa+bNiHjR4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:jKjzQ/eMAqxiDhVLPeQtxwD2AlQ=
Content-Language: en-US
Bytes: 1708

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.