Messages in this thread | | | From | David Laight <> | Subject | RE: [PATCH] x86: Remove a.out support | Date | Thu, 17 Mar 2022 02:32:29 +0000 |
| |
From: Kees Cook > Sent: 16 March 2022 22:30 > > On Wed, Mar 16, 2022 at 01:38:31PM +0100, Arnd Bergmann wrote: > > is in the end, but it's likely easier than a standalone a.out loader > > in user space, or a conversion to ELF format. > > Yeah, the exec format is really simple. The only tricky bit was preparing > the stack and making sure everything landed in the right place for text > and data. James, can you try this? aln and mac run for me, but I'm not > actually exercising them beyond dumping argument lists, etc:
Doesn't that restrict the a.out program to the address space below the normal base address for elf programs? So you'll only be able to load small programs - which might be ok here.
OTOH it might be possible to link the 'loader program' to a high address - the elf loader will probably just load it. Best to link it static to avoid shared lib mmaps and probably try to avoid libc calls.
I was wondering what happens when malloc() starts using sbrk() - but I guess it sees the top of the bss for the loaded and it all works fine.
David
- Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
| |