Re: Best Way to Create String Variables in Assembly
- From: Robert Redelmeier <redelm@xxxxxxxxxxxxxxx>
- Date: Wed, 10 Aug 2005 01:41:06 GMT
bwaichu{at}yahoo.com <bwaichu@xxxxxxxxx> wrote:
> I am running openBSD. And from the man page for brk, sbrk:
> How should I approach this string problem? Since I am
> coding assembly, I am not really worried about portability.
As I believe has been mentioned upthread, it depends on the
length of strings you expect.
I'm sure you've tasted Theo's high-security flavoring
of OpenBSD. Accordingly, I would suggest you put your
strings on the heap via .bss or sbrk(). Do not worry about
overallocating, AFAIK OpenBSD is an overcommit CoW system.
Overusing may be a problem, then you will want to use LIFO
so you can sbrk() to free.
The one place you should _not_ put strings is the stack,
especially without rigorous length checking. That's how
buffer overflow exploits are done, and Theo has taken great
pains to review OpenBSD to remove vulnerabilities. He might
get upset, and you're not being true to your system.
-- Robert
.
- Follow-Ups:
- Re: Best Way to Create String Variables in Assembly
- From: f0dder
- Re: Best Way to Create String Variables in Assembly
- From: bwaichu{at}yahoo.com
- Re: Best Way to Create String Variables in Assembly
- References:
- Best Way to Create String Variables in Assembly
- From: bwaichu{at}yahoo.com
- Re: Best Way to Create String Variables in Assembly
- From: f0dder
- Re: Best Way to Create String Variables in Assembly
- From: bwaichu{at}yahoo.com
- Re: Best Way to Create String Variables in Assembly
- From: T.M. Sommers
- Re: Best Way to Create String Variables in Assembly
- From: Charles A. Crayne
- Re: Best Way to Create String Variables in Assembly
- From: bwaichu{at}yahoo.com
- Re: Best Way to Create String Variables in Assembly
- From: Charles A. Crayne
- Re: Best Way to Create String Variables in Assembly
- From: Robert Redelmeier
- Re: Best Way to Create String Variables in Assembly
- From: bwaichu{at}yahoo.com
- Best Way to Create String Variables in Assembly
- Prev by Date: Re: Best Way to Create String Variables in Assembly
- Next by Date: Re: Best Way to Create String Variables in Assembly
- Previous by thread: Re: Best Way to Create String Variables in Assembly
- Next by thread: Re: Best Way to Create String Variables in Assembly
- Index(es):
Relevant Pages
|