Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 31972 - access-/sandbox-violation with packages on /proc/self/maps
Summary: access-/sandbox-violation with packages on /proc/self/maps
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Sandbox (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: solar (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
: 31973 33692 35306 36735 40842 (view as bug list)
Depends on:
Blocks: 31485
  Show dependency tree
 
Reported: 2003-10-25 07:19 UTC by Thomas Seifert
Modified: 2004-04-19 20:06 UTC (History)
9 users (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 Thomas Seifert 2003-10-25 07:19:04 UTC
Just trying to install db-4.1.25_p1-r2 leads to the following error:

--------------------------- ACCESS VIOLATION
LOG FILE = "/tmp/sandbox-db-4.1.25_p1-r2...

open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
----------------------------------------



Reproducible: Always
Steps to Reproduce:
1. try to emerge db-4.1.25_p1-r2.

Actual Results:  
leads to shown error

Expected Results:  
should just install the package.

root # emerge --info
Portage 2.0.49-r15 (default-x86-1.4, gcc-3.3.1, glibc-2.3.2-r6, 2.4.20-gentoo-r7)
=================================================================
System uname: 2.4.20-gentoo-r7 i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.4.3.11
distcc 2.11.2 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=i686 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /var/bind /usr/X11R6/lib/X11/xkb
/usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache autoaddcvs sandbox fixpackages"
GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo/
http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/
http://ftp.uni-erlangen.de/pub/mirrors/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 oss apm avi crypt cups encode foomaticdb gif jpeg libg++ mad mikmod
mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib alsa gdbm
berkdb slang readline arts tetex bonobo svga tcltk java guile mysql postgres sdl
gpm tcpd pam libwww ssl perl python esd imlib oggvorbis gnome gtk qt kde motif
opengl mozilla cdr gtk2 X"
Comment 1 SpanKY gentoo-dev 2003-10-25 08:04:42 UTC
*** Bug 31973 has been marked as a duplicate of this bug. ***
Comment 2 Paul de Vrieze (RETIRED) gentoo-dev 2003-10-25 13:28:32 UTC
Note that this only seems to hapen with the ibm jdk. However probably a standard
rule in portage is the best solution.
Comment 3 Tim Haughton 2003-10-28 09:12:56 UTC
I have been pegged on the portage tree since this surfaced. Is there any
workaround? It makes me unhappy when I fall behind with my updates ;)
Comment 4 Thomas Seifert 2003-11-03 13:20:49 UTC
next db-4.1.25_p1- release and no change on this topic.
anyone working on it yet? 
would be really really nice to get it solved ... in whichever direction ;).


thomas
Comment 5 Haroon Rafique 2003-11-07 09:53:05 UTC
I can confirm that this is only ibm jdk related. I fixed each one of
the packages that was complaining about the /proc/self/maps violation
by adding a line:

addwrite /proc/self/maps

at the beginning of src_compile(), as explained in bug 31485 comment 7. So,
by using this kludge, I was able to compile postgresql, php, mod_php and
db successfully. For postgresql, I also had to add that line to the
beginning of src_install().
Comment 6 Marius Mauch (RETIRED) gentoo-dev 2003-11-17 11:47:34 UTC
*** Bug 33692 has been marked as a duplicate of this bug. ***
Comment 7 Lesley van Zijl 2003-12-15 06:31:21 UTC
I have this same problem with gettext-0.12.1 
I dont know if gettext has anything to do with java, but I am using blackdown as jdk.




make[3]: Leaving directory `/var/tmp/portage/gettext-0.12.1/work/gettext-0.12.1/gettext-tools/tests'
make[3]: Entering directory `/var/tmp/portage/gettext-0.12.1/work/gettext-0.12.1/gettext-tools'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/var/tmp/portage/gettext-0.12.1/work/gettext-0.12.1/gettext-tools'
make[2]: Leaving directory `/var/tmp/portage/gettext-0.12.1/work/gettext-0.12.1/gettext-tools'
make[1]: Leaving directory `/var/tmp/portage/gettext-0.12.1/work/gettext-0.12.1/gettext-tools'
make[1]: Entering directory `/var/tmp/portage/gettext-0.12.1/work/gettext-0.12.1'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/var/tmp/portage/gettext-0.12.1/work/gettext-0.12.1'
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/tmp/sandbox-gettext-0.12.1-19732.log"

open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
open_wr:   /proc/self/maps
--------------------------------------------------------------------------------
Comment 8 Nicholas Jones (RETIRED) gentoo-dev 2003-12-23 23:53:18 UTC
Predict added to ebuild.sh as a semi-solution.
Comment 9 solar (RETIRED) gentoo-dev 2003-12-23 23:56:46 UTC
Has anybody greped the source code for this yet?
Comment 10 solar (RETIRED) gentoo-dev 2003-12-24 00:01:54 UTC
It would seem key to me to know why it's doing this before adding a +w on a read only file.

Note that /proc/self/maps will appear as 00000000-00000000 on a grsecurity protected kernel so whatever data it's trying to gather from here will break in it's logic.
I'm keen on patching the src to prevent this behavior if it thinks it has a valid reason for doing this. It really cant be valid however as the file is read-only.
Comment 11 solar (RETIRED) gentoo-dev 2003-12-26 18:13:36 UTC
How many of you are using a PAX/grsec enabled kernel with address space
protections?
 
I've merged gettext like crazy and texting various things. I've
discovered after disabling SEGMEXEC, PAGEEXEC, RANDMMAP that everything
seems to work fine. What I assume is happening here is when javac is
called from these ebuilds and the PAX flags are not set, the javac
jumps to it's signal handler and is what is calling the 
fopen("/proc/self/maps", "rt"); which causes the sandbox violation.

Work Around - Please TEST
chpax -zsrp /opt/blackdown-jdk-*/bin/[a-z]*
Comment 12 Lance Albertson (RETIRED) gentoo-dev 2003-12-26 18:37:24 UTC
I've had problems with gettext not compiling on PAX/grsec enabled systems. I was finally able to get gettext to compile correctly when I used chpax -rsp on the java/javac/jar binaries for blackdown.
Comment 13 SpanKY gentoo-dev 2003-12-30 06:39:52 UTC
*** Bug 36735 has been marked as a duplicate of this bug. ***
Comment 14 SpanKY gentoo-dev 2003-12-30 06:40:13 UTC
*** Bug 35306 has been marked as a duplicate of this bug. ***
Comment 15 solar (RETIRED) gentoo-dev 2004-01-23 02:36:42 UTC
I keep the /etc/conf.d/chpax pretty current on known/reported pax flags.

So another option is to let the etc chpax file handle the pax flags for you.

emerge chpax
rc-update add chpax default
/etc/init.d/chpax restart
Comment 16 Axel Reimann 2004-01-23 06:04:22 UTC
a chpax restart gives me the following lines:
> /etc/init.d/chpax restart
 * error: chpax -p /usr/X11R6/bin/XFree86
 * error: chpax -p /opt/blackdown-jdk-1.4.1/jre/bin
 * error: chpax -p /opt/blackdown-jdk-1.4.1/jre/javaws-1_2_0_01-linux-int.zip
 * error: chpax -p /opt/blackdown-jdk-1.4.1/jre/lib
 * error: chpax -p /opt/blackdown-jdk-1.4.1/jre/plugin
 * error: chpax -s /usr/X11R6/bin/XFree86
 * error: chpax -s /opt/blackdown-jdk-1.4.1/jre/bin
 * error: chpax -s /opt/blackdown-jdk-1.4.1/jre/javaws-1_2_0_01-linux-int.zip
 * error: chpax -s /opt/blackdown-jdk-1.4.1/jre/lib
 * error: chpax -s /opt/blackdown-jdk-1.4.1/jre/plugin
 * error: chpax -x /opt/blackdown-jdk-1.4.1/jre/bin
 * error: chpax -x /opt/blackdown-jdk-1.4.1/jre/javaws-1_2_0_01-linux-int.zip
 * error: chpax -x /opt/blackdown-jdk-1.4.1/jre/lib
 * error: chpax -x /opt/blackdown-jdk-1.4.1/jre/plugin

What can I do about it?
Comment 17 solar (RETIRED) gentoo-dev 2004-01-23 09:53:10 UTC
emerge -C chpax
rm /etc/{init,conf}.d/chpax
emerge '>=sys-apps/chpax-0.6.1'
/etc/init.d/chpax restart

That should get rid of most of the java errors.
If a file is in use like your XFree86 was, then you can expect to see an "error" which is telling you that file is in use ie (Text File Busy)
Comment 18 Axel Reimann 2004-01-24 01:30:24 UTC
Yes, that did the trick! Thank you!
Comment 19 Axxackall 2004-01-27 22:22:00 UTC
Negative ehere: chpax didn't help to go around gettext violating the sandbox. I am now in the middle of deciding either to let gettext to violate its sandbox (scared!) or to mask gettext until it will be properly fixed. Any advise?
Comment 20 Axxackall 2004-01-27 23:29:42 UTC
well, after unmerging ibm-jdk-141, I have successfully upgraded gettext to 0.12.1 without any access violation. 

After upgradig gettext, I've re-emerged ibm-jdk-141. Is it, what I've done, securily safe?
Comment 21 solar (RETIRED) gentoo-dev 2004-01-28 01:10:14 UTC
dev-portage I'm taking this bug....
-----------------------------------

Ax,

Please post the output from the following command.

epm -q -l ibm-jdk-here | xargs chpax -v 2>/dev/null| grep chpax | awk '{print $9, $8}'
Comment 22 SpanKY gentoo-dev 2004-02-08 10:49:41 UTC
*** Bug 40842 has been marked as a duplicate of this bug. ***
Comment 23 solar (RETIRED) gentoo-dev 2004-04-08 23:32:27 UTC
Everybody understand how chpax works now?
I assume nobody is having a problem anymore.
Comment 24 solar (RETIRED) gentoo-dev 2004-04-19 20:06:07 UTC
Closing bug as INVALID then