Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 293291 - mail-client/pine-4.64-r7: crashes shortly after startup
Summary: mail-client/pine-4.64-r7: crashes shortly after startup
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-15 15:22 UTC by Anthony Basile
Modified: 2010-07-15 19:19 UTC (History)
1 user (show)

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


Attachments
Last part of strace pine (strace-pine.txt,7.35 KB, text/plain)
2009-11-15 15:31 UTC, Anthony Basile
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2009-11-15 15:22:31 UTC
Pine compiles using the toolchain from the hardened-dev overlay on an amd64 system with pie enabled (gcc-4.4.2-r1 + binutils-2.20 + glibc-2.11), however it crashes on signal 11 shortly after startup, after/when it attempts to access ~/mail.  The crash does not occur if you compile with x86_64-pc-linux-gnu-4.4.2-hardenednopie.

Reproducible: Always

Steps to Reproduce:
1. Use gcc-config to make sure x86_64-pc-linux-gnu-4.4.2 is the default compiler
2. emerge pine
3. pine

Actual Results:  
The first time you run pine, you get the one-time greeting message, and then it crashes just as it is about to give the top level menu.  On subsequent runs, the one-time greeting is skipped (as expected), and pine crashes again just as it is about to give you the top level menu.

Expected Results:  
You should see the menu items.

This problem was discovered with the hardened-dev overlay toolchain, but also occurs on stock hardened gentoo with gcc-4.3.4, binutils-2.18-r3, glibc-2.9_p20081201-r2 on amd64 arch.  Same workaround, using hardenednopie fixes the problem.
Comment 1 Anthony Basile gentoo-dev 2009-11-15 15:23:30 UTC
amd64 system with hardened-dev overlay

Portage 2.1.6.13 (hardened/linux/amd64/10.0/no-multilib, gcc-4.4.2, glibc-2.11-r0, 2.6.28-hardened-r9 x86_64)
=================================================================
System uname: Linux-2.6.28-hardened-r9-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q8400_@_2.66GHz-with-gentoo-1.12.13
Timestamp of tree: Sun, 15 Nov 2009 08:00:01 +0000
app-shells/bash:     4.0_p28
dev-lang/python:     2.6.2-r1
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://192.168.100.9/pub/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/hardened-development"
SYNC="rsync://192.168.100.7/portage"
USE="acl amd64 apache2 berkdb bzip2 cli cracklib crypt cups dri gdbm gpm hardened iconv ipv6 justify mbox mmx modules mudflap mysql ncurses nls nptl nptlonly openmp pam pcre perl pic png pppd python readline reflection session spl sse sse2 ssl sysfs tcpd tordns unicode urandom xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="actions alias asis auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta charset_lite dav dav_fs dav_lock dbd deflate dir disk_cache dumpio env expires ext_filter file_cache filter headers ident imagemap include info log_config log_forensic logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http rewrite setenvif speling status unique_id userdir usertrack version vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 2 Anthony Basile gentoo-dev 2009-11-15 15:24:33 UTC
amd64 system with stock hardened gentoo

Portage 2.1.6.13 (hardened/linux/amd64/10.0, gcc-4.3.4-hardenednopie, glibc-2.9_p20081201-r2, 2.6.28-hardened-r9 x86_64)
=================================================================
System uname: Linux-2.6.28-hardened-r9-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-1.12.13
Timestamp of tree: Sat, 14 Nov 2009 08:00:01 +0000
app-shells/bash:     4.0_p28
dev-lang/python:     2.6.2-r1
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://192.168.100.9/pub/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://192.168.100.7/portage"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cups dri gdbm gpm hardened iconv justify mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pic pppd python readline reflection session spl sse sse2 ssl sysfs tcpd urandom xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="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 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 3 Anthony Basile gentoo-dev 2009-11-15 15:31:42 UTC
Created attachment 210320 [details]
Last part of strace pine

This is the last few lines of strace.  Notice the first two lines show that ~/mail was accessed.  The problem occurs after this.  kern.log report

Nov 15 23:27:04 localhost kernel: grsec: From 192.168.3.7: signal 11 sent to /usr/bin/pine[pine:24380] uid/euid:1000/1000 gid/egid:1000/1000, parent /usr/bin/strace[strace:24379] uid/euid:1000/1000 gid/egid:1000/1000

I should also add that these systems use PaX/grsec hardened kernels.
Comment 4 Eduardo Chappa 2009-11-15 19:14:56 UTC
(In reply to comment #0)
> Pine compiles using the toolchain from the hardened-dev overlay on an amd64
> system with pie enabled (gcc-4.4.2-r1 + binutils-2.20 + glibc-2.11), however it
> crashes on signal 11 shortly after startup, after/when it attempts to access
> ~/mail. 

What would be useful is a backtrace of a session of Pine run under gdb.

Having said this, there is another program, called "Alpine" which does exactly what Pine does. Would it make sense that you move to Alpine, or is there a reason why you still need to use Pine?

Thanks
Comment 5 Anthony Basile gentoo-dev 2009-11-17 13:35:03 UTC
Unfortunately gdb can't handle PIE.  See for example

http://sourceware.org/ml/gdb/2009-08/msg00039.html

If I try to do a backtrace, I get, on two subsequent runs,

Program received signal SIGSEGV, Segmentation fault.                          
0x000007d109e41cb6 in ?? () [ListFldrs]                            
(gdb) bt
#0  0x000007d109e41cb6 in ?? ()
#1  0x0000000000000000 in ?? ()

Program received signal SIGSEGV, Segmentation fault.                       
0x0000057997810cb6 in ?? () [ListFldrs]           
(gdb) bt
#0  0x0000057997810cb6 in ?? ()
#1  0x0000000000000000 in ?? ()


The symbols have *not* been stripped.

Given that 1) the problem only happens when PIE is enabled, 2) debugging with PIE is difficult, 3) there is alpine which, despite the fact that it is masked, compiles and runs fine in the above environment, 4) not much activity seems to be happening upstream with pine, I think this is a bug we can just work around.
Comment 6 Anthony Basile gentoo-dev 2010-07-15 19:19:03 UTC
No longer interested in pursuing this one.  Pine is dead upstream and succeeded by alpine according to http://www.washington.edu/pine/.  I'm closing this one.