[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash's malloc does not work within qemu-user when compiled with PIE
From: |
Raphael Hertzog |
Subject: |
Re: Bash's malloc does not work within qemu-user when compiled with PIE enabled |
Date: |
Tue, 13 Feb 2018 17:23:53 +0100 |
User-agent: |
Mutt/1.9.3 (2018-01-21) |
Hello,
On Tue, 13 Feb 2018, Chet Ramey wrote:
> > It would be nice if bash's malloc implementation could be fixed to also
> > work under qemu-user.
>
> Does sbrk(2) work in a PIE-enabled environment?
Note that a bash binary compiled with PIE works fine for normal usage
with a current Linux kernel. Apparently it was causing troubles with
older Linux kernels, see
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1518483
But with current kernels it works fine. The problem only happens
under qemu-user.
>From what I understood the memory layout of a PIE-compiled binary is
different but sbrk() still works the same. Maybe some assumption that you
are doing about the memory layout are not holding true however.
While trying to learn more about this I found this URL
https://gist.github.com/CMCDragonkai/10ab53654b2aa6ce55c11cfc5b2432a4
I'm sorry but I don't know much more than that on this topic. Maybe some
qemu developers should be involved in the discussion.
Cheers,
--
Raphaël Hertzog ◈ Debian Developer
Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/