--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: linux: kernel does not always provide a heap [alpha arm64 mips64el ppc64el ppc64 s390x sparc64]
- From: Aurelien Jarno <aurel32@debian.org>
- Date: Wed, 07 Feb 2018 12:37:44 +0100
- Message-id: <151800346431.1024.6353899600032152557.reportbug@ohm.local>
Source: linux
Version: 4.14.13-1
Severity: normal
Tags: upstream
When ASLR is enabled (which is the default), the Linux kernel on at
least alpha, arm64, mips64el, ppc64el, ppc64, s390x and sparc64 might
not provide a heap to the program. This is the case for example when
the program is run through the program interpreter ld.so. This happens
with different probability depending on the architecture. This causes
issues with GLIBC tunables support, which needs to be able to reserve
a few hundred bytes of memory through brk. This is reproducible with
at least kernel 4.9 and 4.15, and it's likely that the issue has always
been there.
The following script, based on one from James Cowgill, shows the issue:
#!/bin/bash
export LC_ALL=C
interp=$(readelf --headers /bin/cat | grep 'Requesting program interpreter' | sed -e 's/.*: //' -e 's/]//')
for i in {1..10000}
do
OUT=$($interp /bin/cat /proc/self/maps)
if [[ $OUT != *heap* ]]
then
echo -n F
echo "$OUT"
else
echo -n .
fi
done
A workaround is to set /proc/sys/kernel/randomize_va_space to 1.
--- End Message ---
--- Begin Message ---
- To: Aurelien Jarno <aurel32@debian.org>, 889817-done@bugs.debian.org
- Subject: Re: Bug#889817: linux: kernel does not always provide a heap [alpha arm64 mips64el ppc64el ppc64 s390x sparc64]
- From: Salvatore Bonaccorso <carnil@debian.org>
- Date: Mon, 24 May 2021 08:31:14 +0200
- Message-id: <YKtIMjZwgtZqq8Jg@eldamar.lan>
- In-reply-to: <151800346431.1024.6353899600032152557.reportbug@ohm.local>
- References: <151800346431.1024.6353899600032152557.reportbug@ohm.local>
Source: linux
Source-Version: 5.10.38-1
Hi,
On Wed, Feb 07, 2018 at 12:37:44PM +0100, Aurelien Jarno wrote:
> Source: linux
> Version: 4.14.13-1
> Severity: normal
> Tags: upstream
>
> When ASLR is enabled (which is the default), the Linux kernel on at
> least alpha, arm64, mips64el, ppc64el, ppc64, s390x and sparc64 might
> not provide a heap to the program. This is the case for example when
> the program is run through the program interpreter ld.so. This happens
> with different probability depending on the architecture. This causes
> issues with GLIBC tunables support, which needs to be able to reserve
> a few hundred bytes of memory through brk. This is reproducible with
> at least kernel 4.9 and 4.15, and it's likely that the issue has always
> been there.
>
> The following script, based on one from James Cowgill, shows the issue:
>
> #!/bin/bash
> export LC_ALL=C
>
> interp=$(readelf --headers /bin/cat | grep 'Requesting program interpreter' | sed -e 's/.*: //' -e 's/]//')
>
> for i in {1..10000}
> do
> OUT=$($interp /bin/cat /proc/self/maps)
> if [[ $OUT != *heap* ]]
> then
> echo -n F
> echo "$OUT"
> else
> echo -n .
> fi
> done
>
> A workaround is to set /proc/sys/kernel/randomize_va_space to 1.
As discussed on IRC, I was not able to trigger this behaviour with
4.19.181-1 on amdahl (arm64), zelenka (s390x) or plummer (ppc64el). So
guess the issue has been fixed in meanwhile somewhere.
Not sure it is worth trying to bisect and finding the fixing
commit(s).
But for now closing with all recent versions in supported branches.
Regards,
Salvatore
--- End Message ---