Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 904944 - sys-apps/hwloc-2.8.0-r1 (stable) gives sandbox error on /dev/char/
Summary: sys-apps/hwloc-2.8.0-r1 (stable) gives sandbox error on /dev/char/
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-24 04:29 UTC by Simon
Modified: 2023-06-04 13:54 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,24.92 KB, text/plain)
2023-04-24 04:48 UTC, Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon 2023-04-24 04:29:50 UTC
I'm getting a sandbox error when trying to reinstall hwloc:
https://bpa.st/7WSXG

The bug is probably related to https://bugs.gentoo.org/904292
So maybe similar solution?

Reproducible: Always
Comment 1 Simon 2023-04-24 04:44:04 UTC
# emerge --info                                                                                                                                                                                                                                                                            
Mo 24. Apr 06:49:59 CEST 2023
Portage 3.0.44 (python 3.10.10-final-0, default/linux/amd64/17.1/desktop, gcc-11, glibc-2.36-r7, 5.15.85-gentoo x86_64)
=================================================================
System uname: Linux-5.15.85-gentoo-x86_64-Intel-R-_Core-TM-_i5-10600_CPU_@_3.30GHz-with-glibc2.36
KiB Mem:    16093200 total,   1734084 free
KiB Swap:   33791996 total,  30041124 free
Timestamp of repository gentoo: Mon, 24 Apr 2023 02:00:01 +0000
Head commit of repository gentoo: ac040db159185e23bda9b465f0c8e934a09f86cc
sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.39 p6) 2.39.0
distcc 3.4 x86_64-pc-linux-gnu [disabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r2::gentoo
dev-lang/python:           3.10.10_p3::gentoo, 3.11.2_p2::gentoo
dev-lang/rust:             1.66.1::gentoo
dev-util/cmake:            3.25.3::gentoo
dev-util/meson:            1.0.1::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/openrc:           0.46::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r1::gentoo
sys-devel/gcc:             11.3.1_p20230120-r1::gentoo, 12.2.1_p20230121-r1::gentoo
sys-devel/gcc-config:      2.10::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo
sys-devel/llvm:            15.0.7::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 

crossdev
    location: /var/db/repos/crossdev
    masters: gentoo
    priority: 10
    volatile: True

ROKO__
    location: /var/lib/layman/ROKO__
    masters: gentoo
    priority: 50
    volatile: True

darkelf
    location: /var/lib/layman/darkelf
    masters: gentoo
    priority: 50
    volatile: True

guru
    location: /var/lib/layman/guru
    masters: gentoo
    priority: 50
    volatile: True

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 50
    volatile: True

emake
    location: /var/db/repos/emake
    masters: gentoo
    priority: 750
    volatile: True

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
LINGUAS="de en de_DE"
MAKEOPTS="-j8"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/zsh"
USE="X a52 aac acl acpi alsa amd64 atasmart bindist bluetooth boost branding bzip2 cairo cdda cdr cli crossdev crypt cryptsetup cuda cups dav1d dbus dia discord dri dts dvd dvdr egl elogind encode exif ffmpeg fftw flac fluidsynth fortran gdbm gif glade gpm gstreamer gtk gui iconv icu imagemagick iproute2 ipv6 iwd jack jpeg jpegxl kerberos latex lcms libcaca libglvnd libnotify libtirpc mad metric midi mmx mng mp3 mp4 mpeg mtp multilib ncurses networkmanager nls nptl nvenc offensive ogg opencl openexr opengl openmp opus pam pango pcre pdf png policykit postscript ppds pulseaudio raw readline sdl seccomp smp sound sparse spell split-usr sse sse2 ssl startup-notification svg svg2 test-rust threaded threads threadsafe thunar tiff truetype udev udisks unicode upower usb v4l vaapi vdpau vim-syntax vorbis vp8 vp9 vpx vtk vulkan webm webp wxwidgets x264 x265 xattr xcb xft xinerama xml xrandr xv xvid zlib zsh-completion" ABI_X86="64" ADA_TARGET="gnat_2021" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics joystick libinput" KERNEL="linux" L10N="de de-1901 en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86 NVPTX" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10 python3_11" RUBY_TARGETS="ruby30" USERLAND="GNU" VIDEO_CARDS="intel i965 iris nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 2 Simon 2023-04-24 04:48:10 UTC
Created attachment 860677 [details]
build.log
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-25 03:56:39 UTC
I wonder why this is happening more now.

 * ----------------------- SANDBOX ACCESS VIOLATION SUMMARY -----------------------
 * LOG FILE: "/var/tmp/portage/sys-apps/hwloc-2.8.0-r1/temp/sandbox.log"
 * 
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: remove
S: deny
P: /dev/char/195:255
A: /dev/char/195:255
R: /dev/char/195:255
C: ./conftest 

F: symlink
S: deny
P: /dev/char/195:255
A: /dev/char/195:255
R: /dev/char/195:255
C: ./conftest 
 * --------------------------------------------------------------------------------
Comment 4 Kévin Petit 2023-05-14 13:41:24 UTC
I'm hitting the same issue with =sys-apps/hwloc-2.9.0 or =sys-apps/hwloc-2.9.1.
Comment 5 gertoe 2023-05-16 14:13:37 UTC
The sandbox violation occurs on /dev/char/... if the cuda use flag is set. The referenced char device (in my case /dev/char/195:255) symlinks to /dev/nvidiactl which is owned by root:video with permissions set to 0660, so Portage has no access permissions. A (dirty) workaround for completing the merge is to temporarily set permissions on /dev/nvidiactl to 0666.
Comment 6 Larry the Git Cow gentoo-dev 2023-06-04 13:36:14 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c1e2bb5e15c833363367382e9f1c44b9eeae0a0

commit 9c1e2bb5e15c833363367382e9f1c44b9eeae0a0
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2023-06-04 10:47:05 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2023-06-04 13:35:43 +0000

    x11-drivers/nvidia-drivers: use sandbox.d for /dev/nvidiactl+/dev/char
    
    /dev/nvidiactl been a long standing issue, sometime appearing in sneaky
    ways when a revdeps is built with opencl/cuda support even though the
    package itself does not use it.
    
    And /dev/char is newly needed with >=nvidia-drivers-525.105.17 or
    >=535.43.02, but not 530.41.03. The production branch's 525.105.17
    is newer than ~arch's long-living 530 and led to this being overlooked
    until it hit stable (older stable 525.89.02 was not affected) and
    was unaware of this until rebuilt libomp[offload] with 535 today
    (note that 535.43.02 is unkeyworded, it's a beta).
    
    Need /dev/char rather than /dev/char/195:255 given it tries to remove
    + create a symlink and does not simply try to write there.
    
    This is not meant to be a full coverage of nvidia devices and only
    for those being a widespread problem. Special needs or addwrite
    (typically to run tests) should be handled manually or using
    cuda.eclass' cuda_add_sandbox.
    
    Adding /dev/char to all versions even if not needed *yet* just so it's
    not overlooked when nvidia spreads it to other branches (except 390
    given it's EOL, not to mention has no cuda packages anymore).
    
    Bug: https://bugs.gentoo.org/904292
    Bug: https://bugs.gentoo.org/905436
    Closes: https://bugs.gentoo.org/904944
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild           | 7 +++++++
 ...ivers-470.182.03.ebuild => nvidia-drivers-470.182.03-r1.ebuild} | 7 +++++++
 ...ivers-515.105.01.ebuild => nvidia-drivers-515.105.01-r1.ebuild} | 7 +++++++
 ...ivers-525.116.04.ebuild => nvidia-drivers-525.116.04-r1.ebuild} | 7 +++++++
 ...drivers-525.47.26.ebuild => nvidia-drivers-525.47.26-r1.ebuild} | 7 +++++++
 ...drivers-530.41.03.ebuild => nvidia-drivers-530.41.03-r1.ebuild} | 7 +++++++
 ...drivers-535.43.02.ebuild => nvidia-drivers-535.43.02-r1.ebuild} | 7 +++++++
 7 files changed, 49 insertions(+)
Comment 7 Ionen Wolkens gentoo-dev 2023-06-04 13:54:17 UTC
fwiw may optionally want to add the addpredict in the ebuild anyway as portage may still attempt to build it before nvidia-drivers is rebuilt given no dependency checks

albeit people that enable USE=cuda are probably unfortunately used to this kind of annoyance