Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #60160

Bug#889817: linux: kernel does not always provide a heap [alpha arm64 mips64el ppc64el ppc64 s390x sparc64]

From Aurelien Jarno <aurel32@debian.org>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#889817: linux: kernel does not always provide a heap [alpha arm64 mips64el ppc64el ppc64 s390x sparc64]
Date 2018-02-07 12:40 +0100
Message-ID <vgweZ-4wj-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


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.

Back to linux.debian.kernel | Previous | Next | Find similar | Unroll thread


Thread

Bug#889817: linux: kernel does not always provide a heap [alpha arm64 mips64el ppc64el ppc64 s390x sparc64] Aurelien Jarno <aurel32@debian.org> - 2018-02-07 12:40 +0100

csiph-web