Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 816900 - sys-apps/openrc: checkpath exits with 'free(): invalid pointer' when launching www-apps/grafana-bin with init scripts
Summary: sys-apps/openrc: checkpath exits with 'free(): invalid pointer' when launchin...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Stabilization (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: OpenRC Team
URL: https://github.com/OpenRC/openrc/comm...
Whiteboard:
Keywords: PATCH
: 818049 (view as bug list)
Depends on:
Blocks: CVE-2021-42341
  Show dependency tree
 
Reported: 2021-10-08 01:41 UTC by techno
Modified: 2021-10-14 06:32 UTC (History)
4 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 techno 2021-10-08 01:41:51 UTC
Portage 3.0.20 (python 3.9.6-final-0, default/linux/amd64/17.1/hardened/selinux, gcc-10.3.0, glibc-2.33-r7, 5.10.69-hardened1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.10.69-hardened1-x86_64-Intel-R-_Xeon-R-_E-2276G_CPU_@_3.80GHz-with-glibc2.33
KiB Mem:    16248508 total,    348320 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Thu, 07 Oct 2021 00:45:01 +0000
Timestamp of repository go-overlay: Mon, 27 Sep 2021 17:07:13 +0000
Head commit of repository go-overlay: f2750feebdd1ff576942cb8463675116b1abed78

Timestamp of repository monero: Sun, 19 Sep 2021 21:52:08 +0000
Head commit of repository monero: bd4ab930856ad9e022f08d24c7636d3d96c5331f

Head commit of repository sakaki-tools: 571e34870d665e98677caecbd56cf0d399ee4b3c

sh bash 5.1_p8
ld GNU ld (Gentoo 2.37_p1 p0) 2.37
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0-r2::gentoo
dev-lang/python:          3.8.12::gentoo, 3.9.6_p2::gentoo
dev-lang/rust:            1.53.0::gentoo
dev-util/cmake:           3.20.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.43.5::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.69-r5::gentoo, 2.71-r1::gentoo
sys-devel/automake:       1.16.4::gentoo
sys-devel/binutils:       2.37_p1::gentoo
sys-devel/gcc:            10.3.0-r2::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: webrsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-webrsync-verify-signature: yes

go-overlay
    location: /var/db/repos/go-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/go-overlay.git
    masters: gentoo

monero
    location: /var/db/repos/monero
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/monero.git
    masters: gentoo

bitcoin
    location: /var/lib/layman/bitcoin
    sync-type: laymansync
    sync-uri: https://gitlab.com/bitcoin/gentoo.git
    masters: gentoo
    priority: 50

sakaki-tools
    location: /var/db/repos/sakaki-tools
    sync-type: git
    sync-uri: https://github.com/sakaki-/sakaki-tools.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -falign-functions=32"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.8/conf /var/lib/i2pd/certificates"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/apache2-php8.0/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cgi-php8.0/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/php/cli-php8.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe -falign-functions=32"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=13 --load-average=12"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-march=native -O2 -pipe -falign-functions=32"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news nostrip parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe -falign-functions=32"
GENTOO_MIRRORS="https://gentoo.osuosl.org/ https://mirrors.rit.edu/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j13 -l12"
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"
USE="acl amd64 audit btrfs bzip2 caps crypt hardened http2 iconv idn ipv6 jpeg libglvnd libtirpc multilib ncurses nls nptl openmp pam pcre pie png postgres python readline seccomp selinux socks5 split-usr ssl ssp tiff unicode webp xattr xtpax zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2019" 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" 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 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" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1 lua5-4 luajit" NGINX_MODULES_STREAM="access geoip2 realip javascript ssl_preread upstream_zone return map" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_8 python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="intel i965" 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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

=================================================================
                        Package Settings
=================================================================

www-apps/grafana-bin-8.1.5::gentoo was built with the following:
USE="" ABI_X86="(64)"


# /etc/init.d/grafana -v -d start
[snip]
++ command -v start_pre
+ '[' start_pre = start_pre ']'
+ start_pre
+ checkpath -d -o grafana:grafana -m750 /var/lib/grafana
+ checkpath -d -o grafana:grafana -m750 /var/lib/grafana/dashboards
+ checkpath -d -o grafana:grafana -m750 /var/lib/grafana/plugins
free(): invalid pointer
/etc/init.d/grafana: line 32: 43373 Aborted                 checkpath -d -o "${GRAFANA_USER}:${GRAFANA_GROUP}" -m750 "${GRAFANA_DATADIR}/plugins"
+ return 1
+ exit 1
 * ERROR: grafana failed to start

# go version
go version go1.17.1 linux/amd64

grafana.ini
http_addr = 127.0.0.1
http_port = 3001
domain = dash.domain.tld
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana
serve_from_sub_path = true
router_logging = true
ssl_mode = require
url = postgres://grafana:password@127.0.0.1:5432/grafana


I can start it manually 

# sudo -u grafana grafana-server -config=/etc/grafana/grafana.ini -homepath=/usr/share/grafana cfg:default.paths.data=/var/lib/grafana cfg:default.paths.logs=/var/log/grafana
INFO[10-07|20:50:17] Starting Grafana                         logger=server version=8.1.5 commit=c725a4259a branch=HEAD compiled=2021-09-21T04:54:08-0400
Comment 1 Gary E. Miller 2021-10-08 02:27:36 UTC
I've had this problem for months!  If I had only waited another day...
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2021-10-14 05:07:45 UTC
*** Bug 818049 has been marked as a duplicate of this bug. ***
Comment 3 Larry the Git Cow gentoo-dev 2021-10-14 05:32:12 UTC
The bug has been closed via the following commit(s):

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

commit c6e45be273accf314fb925d977597adde67ba825
Author:     William Hubbs <williamh@gentoo.org>
AuthorDate: 2021-10-14 05:31:29 +0000
Commit:     William Hubbs <williamh@gentoo.org>
CommitDate: 2021-10-14 05:32:00 +0000

    sys-apps/openrc:  0.44.6-r1 bump
    
    Closes: https://bugs.gentoo.org/816900
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: William Hubbs <williamh@gentoo.org>

 .../openrc/files/openrc-0.44.6-fix-checkpath.patch |  33 ++++
 sys-apps/openrc/openrc-0.44.6-r1.ebuild            | 168 +++++++++++++++++++++
 2 files changed, 201 insertions(+)