Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 271260

Summary: sys-apps/sandbox-1.6-r2: Apps which call fopen64() fail to open large files when inside the sandbox
Product: Gentoo Linux Reporter: T Chan <something-bz>
Component: [OLD] Core systemAssignee: Sandbox Maintainers <sandbox>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description T Chan 2009-05-26 03:58:32 UTC
Calls to fopen64() inside the sandbox appear to actually call fopen(). I haven't managed to figure out how to breakpoint libc's fopen() and fopen64() to find out what's going on.

Reproducible: Always

Steps to Reproduce:
1. dd bs=1 if=/dev/zero seek=2500M of=largefile count=1
2. echo 'int main() { if (!fopen("largefile","rb")) warn("fopen"); return 0; }' | gcc -include stdio.h -include err.h -o largefile.32 -x c /dev/fd/0
3. echo 'int main() { if (!fopen64("largefile","rb")) warn("fopen"); return 0; }' | gcc -include stdio.h -include err.h -o largefile.64 -x c /dev/fd/0
4. ./largefile.32
5. ./largefile.64
6. sandbox ./largefile.64

Actual Results:  
$ ./largefile.32
largefile.32: fopen: Value too large for defined data type

$ ./largefile.64

$ sandbox ./largefile.64
largefile.64: fopen: Value too large for defined data type

Expected Results:  
It succeeds.

Portage 2.1.6.11 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.8_p20080602-r1, 2.6.26-gentoo-r4-na12 i686)
=================================================================
System uname: Linux-2.6.26-gentoo-r4-na12-i686-VIA_Esther_processor_1500MHz-with-glibc2.0
Timestamp of tree: Mon, 25 May 2009 20:30:01 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.5.4-r2
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.6.3, 1.7.9-r1, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-pipe -march=i686 -mtune=i686 -mfpmath=sse -msse2 -O2 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-pipe -march=i686 -mtune=i686 -mfpmath=sse -msse2 -O2 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict test unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j2"
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"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="aac aalib acl apache2 audiofile berkdb bzip2 bzlib calendars cli cracklib crypt curl dri fortran gcj gdbm gpm hal iconv imap ipv6 isdnlog java javascript jpeg memlimit midi mime mmap mmx mp3 mudflap ncurses nls nptl nptlonly ogg openmp pam pcre perl php png pppd python readline reflection samba session skey spl ssl svg sysfs tcpd tiff unicode usb x86 xattr xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex dbd deflate dir env expires ext_filter filter headers ident include info log_config logio mime mime_magic negotiation rewrite setenvif so status userdir 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="dummy fbdev vesa vga sis via"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sebastian Luther (few) 2009-05-26 06:30:21 UTC
Are newer version affected?
Comment 2 T Chan 2009-05-27 01:49:13 UTC
Not affected: 1.2.18.1-r2, 1.2.18.1-r3, 1.2.20_alpha2-r1, 1.3.0, 1.3.1, 1.3.2
Affected: 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.4, 1.5, 1.6, 1.6-r1, 1.6-r2, 1.7, 1.8, 1.9

(That was a minor pain to do...)

Presumably not related to bug #96564.