Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 467306 - net-ftp/vsftpd-3.0.2 segfaults with sys-libs/uclibc-0.9.33.2-r{2,3}
Summary: net-ftp/vsftpd-3.0.2 segfaults with sys-libs/uclibc-0.9.33.2-r{2,3}
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: NeedPatch
Depends on: 470608
Blocks: uclibc-porting
  Show dependency tree
 
Reported: 2013-04-26 07:31 UTC by Sergey Popov
Modified: 2018-10-14 12:09 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,11.33 KB, text/plain)
2013-04-26 07:31 UTC, Sergey Popov
Details
vsftpd.conf (vsftpd.conf,4.49 KB, text/plain)
2013-04-26 07:32 UTC, Sergey Popov
Details
uclibc savedconfig (uclibc-0.9.33.2-r3,6.25 KB, text/plain)
2013-04-26 07:33 UTC, Sergey Popov
Details
vsftpd-3.0.2-remove-ssp.patch (vsftpd-3.0.2-remove-ssp.patch,355 bytes, text/plain)
2013-05-12 15:56 UTC, Sergey Popov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Popov gentoo-dev 2013-04-26 07:31:15 UTC
Created attachment 346620 [details]
build.log

I have upgraded vsftpd from 2.3.5 to 3.0.2 and now it just not starts.

phantom ~ # gdb vsftpd
GNU gdb (Gentoo 7.5.1 p2) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-gentoo-linux-uclibc".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/sbin/vsftpd...done.
(gdb) run
Starting program: /usr/sbin/vsftpd 

Program received signal SIGSEGV, Segmentation fault.
vsf_sysutil_get_ipaddr_size () at sysutil.c:2107
2107    {
(gdb) bt
#0  vsf_sysutil_get_ipaddr_size () at sysutil.c:2107
#1  0x56568f65 in vsf_standalone_main () at standalone.c:42
#2  0x5655a5ea in main (argc=1, argv=0xffffd1f4) at main.c:154

I will provide necessary information in attachments...

phantom ~ # emerge --info vsftpd
Portage 2.1.11.50 (uclibc/x86, gcc-4.6.3, uclibc-0.9.33.2-r3, 3.7.10-gentoo-r1-BADO x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.7.10-gentoo-r1-BADO-x86_64-Intel-R-_Core-TM-_i7_CPU_950_@_3.07GHz-with-gentoo-2.1
KiB Mem:     8166424 total,   1868968 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Wed, 24 Apr 2013 21:45:01 +0000
ld GNU ld (GNU Binutils) 2.21.1
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.69
sys-devel/automake:       1.12.6
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/uclibc:          0.9.33.2-r3
Repositories: gentoo router_repo
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i386-gentoo-linux-uclibc"
CFLAGS="-O0 -g -ggdb -mtune=i686 -pipe"
CHOST="i386-gentoo-linux-uclibc"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-O0 -g -ggdb -mtune=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-Os"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nodoc noinfo noman nostrip parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-Os"
GENTOO_MIRRORS="ftp://192.168.1.10/Gentoo"
LANG="ru_RU.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j10"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="cli cxx dri ipv6 minimal modules mudflap openmp pcre session threads uclibc unicode x86 zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="uclibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

net-ftp/vsftpd-3.0.2 was built with the following:
USE="-caps -pam (-selinux) -ssl -tcpd -xinetd"
Comment 1 Sergey Popov gentoo-dev 2013-04-26 07:32:13 UTC
Created attachment 346622 [details]
vsftpd.conf
Comment 2 Sergey Popov gentoo-dev 2013-04-26 07:33:28 UTC
Created attachment 346624 [details]
uclibc savedconfig
Comment 3 SpanKY gentoo-dev 2013-04-26 19:09:07 UTC
my guess is it's the same as bug 455236
Comment 4 Sergey Popov gentoo-dev 2013-04-28 07:14:06 UTC
(In reply to comment #3)
> my guess is it's the same as bug 455236

Yep, vsftpd 3.0.2 forces adding of some CFLAGS: "-fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Wformat-security", while 2.3.5 is not.

What we should do next? Dropping these CFLAGS is a workaround in this case, is not it?
Comment 5 Anthony Basile gentoo-dev 2013-04-28 13:09:27 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > my guess is it's the same as bug 455236
> 
> Yep, vsftpd 3.0.2 forces adding of some CFLAGS: "-fstack-protector
> --param=ssp-buffer-size=4 -Wall -W -Wshadow -Wformat-security", while 2.3.5
> is not.
> 
> What we should do next? Dropping these CFLAGS is a workaround in this case,
> is not it?

If you add -fno-stack-protector to the end of your CFLAGS list, you will turn it off.  You could just safely add it to your make.conf file since you can't support any ssp on any package without ssp in uclibc.

Alternatively, you can recompile uclibc with ssp.  I didn't hit this bug when it affected sudo (bug #455236) because I always do a fully hardened system.
Comment 6 Sergey Popov gentoo-dev 2013-05-12 15:56:53 UTC
Created attachment 348090 [details]
vsftpd-3.0.2-remove-ssp.patch

(In reply to comment #5)
> If you add -fno-stack-protector to the end of your CFLAGS list, you will
> turn it off.  You could just safely add it to your make.conf file since you
> can't support any ssp on any package without ssp in uclibc.

Unfortunately package.env does not help in this case, cause -fstack-protector is added after -fno-stack-protector.

So, i offer to remove adding this flags by default, patch is attached
Comment 7 Markos Chandras (RETIRED) gentoo-dev 2013-05-12 16:56:54 UTC
(In reply to comment #6)
> Created attachment 348090 [details]
> vsftpd-3.0.2-remove-ssp.patch
> 
> (In reply to comment #5)
> > If you add -fno-stack-protector to the end of your CFLAGS list, you will
> > turn it off.  You could just safely add it to your make.conf file since you
> > can't support any ssp on any package without ssp in uclibc.
> 
> Unfortunately package.env does not help in this case, cause
> -fstack-protector is added after -fno-stack-protector.
> 
> So, i offer to remove adding this flags by default, patch is attached

I am not happy with this. I prefer to keep the upstream flags in place. It might be best to add the user specific cflags at the end. Something like

--- Makefile.orig	2013-05-12 17:55:50.249655036 +0100
+++ Makefile	2013-05-12 17:56:06.133656567 +0100
@@ -5,7 +5,7 @@
 #CFLAGS = -g
 CFLAGS	=	-O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \
 	-Wall -W -Wshadow -Werror -Wformat-security \
-	-D_FORTIFY_SOURCE=2 \
+	-D_FORTIFY_SOURCE=2 $(CFLAGS) \
 	#-pedantic -Wconversion
Comment 8 Sergey Popov gentoo-dev 2013-05-12 19:04:44 UTC
(In reply to comment #7)
> I am not happy with this. I prefer to keep the upstream flags in place. It
> might be best to add the user specific cflags at the end. Something like
> 
> --- Makefile.orig	2013-05-12 17:55:50.249655036 +0100
> +++ Makefile	2013-05-12 17:56:06.133656567 +0100
> @@ -5,7 +5,7 @@
>  #CFLAGS = -g
>  CFLAGS	=	-O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \
>  	-Wall -W -Wshadow -Werror -Wformat-security \
> -	-D_FORTIFY_SOURCE=2 \
> +	-D_FORTIFY_SOURCE=2 $(CFLAGS) \
>  	#-pedantic -Wconversion

Please do it
Comment 9 Markos Chandras (RETIRED) gentoo-dev 2013-05-12 19:25:56 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > I am not happy with this. I prefer to keep the upstream flags in place. It
> > might be best to add the user specific cflags at the end. Something like
> > 
> > --- Makefile.orig	2013-05-12 17:55:50.249655036 +0100
> > +++ Makefile	2013-05-12 17:56:06.133656567 +0100
> > @@ -5,7 +5,7 @@
> >  #CFLAGS = -g
> >  CFLAGS	=	-O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \
> >  	-Wall -W -Wshadow -Werror -Wformat-security \
> > -	-D_FORTIFY_SOURCE=2 \
> > +	-D_FORTIFY_SOURCE=2 $(CFLAGS) \
> >  	#-pedantic -Wconversion
> 
> Please do it
does it work for you? i haven't tested that at all. If so, please commit
Comment 10 SpanKY gentoo-dev 2013-05-13 04:47:29 UTC
(In reply to comment #7)

that won't work.  make will throw a recursive error.

of course, does this mean vsftpd isn't respecting the user's CFLAGS ?  that's bad independent of this.

i think we need to come up with a USE flag to control automatic SSP/PIE behavior.  something like USE=ssp_network and USE=pie_network.
Comment 11 Anthony Basile gentoo-dev 2018-10-14 12:09:21 UTC
sys-libs/uclibc has been removed from the tree, replaced by sys-libs/uclibc-ng