[vserver] util-vserver segfault with SSP

From: Romain Rivière <romain+vserver_at_forty-two.fr>
Date: Wed 13 Dec 2017 - 22:55:48 GMT
Message-ID: <187fa944-06ea-dc4d-b7ac-2d7233950559@forty-two.fr>

Hi there,

A couple of years ago, I remember reporting some issues with Gentoo's
hardened profile. Today, after a couple of upgrades, I investigated just
a tad further.

When building util-vserver with a hardened gcc, vserver-stat (maybe
others?) segfaults right out of the box:

# strace -f -s0 vserver-stat
 execve("/usr/sbin/vserver-stat", [...], [/* 40 vars */]) = 0
 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x28} ---
 +++ killed by SIGSEGV +++
 Segmentation fault

After some trial and error, I managed to determine that using the
"nossp" version of the hardened profile was key to obtaining usable
binaries. However, simply adding -fno-stack-protector to the CFLAGS is
not enough, so there must be something else.

It looks like a NULLDEREF right from the start, but that's about the
extent of my knowledge of C/C++, so I'd appreciate some input here :)

Cheers

-- 
Romain
Received on Wed Dec 13 22:54:22 2017
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 13 Dec 2017 - 22:54:22 GMT by hypermail 2.1.8