Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 21693 - Secure umask 077 causes random errors when using userpriv/sandbox that need kernel files like .config and modversions.h
Summary: Secure umask 077 causes random errors when using userpriv/sandbox that need k...
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 65460 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-05-26 00:34 UTC by Greg Watson (linuxkrn)
Modified: 2011-10-30 22:35 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Watson (linuxkrn) 2003-05-26 00:34:52 UTC
When running emerge <package> that need to access files in /usr/src/linux when a
secure umask of 077 or 007 ebuilds fail with random errors OTHER then permission
denied when trying to access files like /usr/src/linux/.config and
modversions.h.  Possilbe fix would be to make the ebuild kernel source have the
group portage and g+rx.



Reproducible: Always
Steps to Reproduce:
1. set default umask 077
2. compile/configure kernel source
3. run portage in userpriv/sandbox and try to merge something like alsa-drivers

Actual Results:  
!!! ERROR: media-sound/alsa-driver-0.9.3c-r1 failed. !!! Function src_compile,
Line 59, Exitcode 2 !!! Parallel Make Failed

and
/tmp/portage/alsa-driver-0.9.3c-r1/work/alsa-driver-0.9.3c/include/adriver.h:42:31:
linux/modversions.h: No such file or directory



Expected Results:  
driver emerged

This is a rather hard error to pinpoint since running emerge as root leads one
to believe it would be able to access the needed files.
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2004-02-09 01:57:17 UTC
still an issue ?
Comment 2 Elan Ruusamäe 2004-09-28 10:25:50 UTC
yes. it is!


linux-2.6.8.1-ck8 # emerge alsa-driver
Calculating dependencies ...done!
>>> emerge (1 of 1) media-sound/alsa-driver-1.0.6a to /
>>> md5 src_uri ;-) alsa-driver-1.0.6a.tar.bz2
>>> Unpacking source...
>>> Unpacking alsa-driver-1.0.6a.tar.bz2 to /var/tmp/portage/alsa-driver-1.0.6a/work
*         >> Compiling 2.6.8-ck8 modules...
 * Applying alsa-driver-1.0.5-devfix.patch...                                                                      [ ok ]
 * Applying alsa-driver-1.0.5a-cs46xx-passthrough.patch...                                                         [ ok ]
 * Applying alsa-driver-1.0.6a-kbuild.patch...                                                                     [ ok ]
 * /usr/src/linux is a symbolic link

checking for inline... inline
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking for current directory... /var/tmp/portage/alsa-driver-1.0.6a/work/alsa-driver-1.0.6a
checking cross compile...
checking for directory with kernel source... /usr/src/linux
checking for kernel version... The file /usr/src/linux/include/linux/version.h does not exist.
Please, install the package with full kernel sources for your distribution
or use --with-kernel=dir option to specify another directory with kernel
sources (default is /usr/src/linux).

!!! ERROR: media-sound/alsa-driver-1.0.6a failed.
!!! Function econf, Line 362, Exitcode 1
!!! econf failed

linux-2.6.8.1-ck8 # l include/linux/version.h
-rw-rw----  1 root root 129 Sep 28 20:13 include/linux/version.h
linux-2.6.8.1-ck8 # chmod -R a+rX .

linux-2.6.8.1-ck8 # umask
0007

linux-2.6.8.1-ck8 # emerge info
Portage 2.0.50-r11 (2004.2, gcc-3.3.4, glibc-2.3.3.20040420-r1, 2.4.22-1.2115.nptlsmp)
=================================================================
System uname: 2.4.22-1.2115.nptlsmp i686 Intel(R) Xeon(TM) CPU 2.80GHz
Gentoo Base System version 1.4.16
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium4 -mfpmath=sse -msse2 -mmmx -pipe -fomit-frame-pointer -falign-functions=4"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium4 -mfpmath=sse -msse2 -mmmx -pipe -fomit-frame-pointer -falign-functions=4"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache distcc sandbox sfperms userpriv usersandbox"
GENTOO_MIRRORS="ftp://ftp.linux.ee/pub/gentoo/distfiles http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://gentoo.linux.no/ ftp://gentoo.linux.no/pub/gentoo/ http://ftp.easynet.nl/mirror/gentoo/"
MAKEOPTS="-j25"
PKGDIR="/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/gentoo/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X aalib acpi alsa apache2 arts artswrappersuid avi bitmap-fonts chroot crypt cups dga directfb dvd encode extensions fbcon flac gif gphoto2 gpm gstreamer gtk gtk2 imap imlib java javascript jikes jpeg kde libg++ libwww linguas_et mad maildir md5sum memlimit mmx motif mpeg mysql ncurses oggvorbis opengl oss pam pda pdflib perl png qt quicktime readline samba scanner sdl slang slp spell sse ssl svga tcltk tiff truetype usb x86 xinerama xml2 xprint xv zlib"

Comment 3 Elan Ruusamäe 2004-10-15 16:21:48 UTC
can paste another one:
emerge of x11-base/xorg-x11-6.8.0-r1:

 *   9970_all_dlloader-imake-fix.patch...                                                                          [ ok ]
 *   9980_all_6.7.99.904-fix-encodings.patch...                                                                    [ ok ]
 * Done with patching
 * Setting up config/cf/host.def...
awk: cmd. line:2: fatal: cannot open file `//usr/src/linux/include/linux/version.h' for reading (Permission denied)
/usr/sbin/ebuild.sh: line 74: [: : integer expression expected
!debug
x86
x86
xprint                                                                                                             [ ok ]
>>> Source unpacked.
 * Setting make jobs to "-j8" to ensure successful merge...
 * Building xorg-x11...

Building Release 6.8.

I hope you checked the configuration parameters in ./config/cf
to see if you need to pass BOOTSTRAPCFLAGS.

Sat Oct 16 02:16:50 EEST 2004

cd ./config/imake && make - --jobserver-fds=3,5 -j -f Makefile.ini BOOTSTRAPCFLAGS="" CC="gcc" clean
make[1]: Entering directory `/var/tmp/portage/xorg-x11-6.8.0-r1/work/xc/config/imake'
rm -f ccimake imake.o imake


# ls -lad //usr/src/linux/include/linux/version.h
-rw-rw----  1 root root 131 Oct 13 19:57 //usr/src/linux/include/linux/version.h


Comment 4 Jakub Moc (RETIRED) gentoo-dev 2005-08-29 03:24:58 UTC
*** Bug 65460 has been marked as a duplicate of this bug. ***
Comment 5 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-01-02 21:49:26 UTC
Turn off userpriv?