Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 739714 - net-misc/chrony-3.5.1-r1 - chronyd -F 1 crashes
Summary: net-misc/chrony-3.5.1-r1 - chronyd -F 1 crashes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CVE-2020-14367
  Show dependency tree
 
Reported: 2020-08-31 06:32 UTC by Ro Man
Modified: 2020-09-02 15:51 UTC (History)
0 users

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 Ro Man 2020-08-31 06:32:24 UTC
When having rtcsync in /etc/chrony/chrony.conf, the chronyd daemon crashes after start

Reproducible: Always

Steps to Reproduce:
1.add rtcsync in /etc/chrony/chrony.conf (it is there by default)
2.start chrony
3.check after several seconds if it is still running
Actual Results:  
It crashes

Expected Results:  
It does not crashes

Chrony crashes with:
Program terminated with signal SIGSYS, Bad system call.
Comment 1 Ro Man 2020-08-31 06:35:39 UTC
I'm running vanilla kernel 5.8.5. This didn't happen with previous version (3.5-r2) and is not happening with 4.0_pre3.
Comment 2 Ro Man 2020-08-31 06:40:12 UTC
Portage 3.0.4 (python 3.7.8-final-0, default/linux/amd64/17.1, gcc-9.3.0, glibc-2.31-r6, 5.8.5 x86_64)
=================================================================
System uname: Linux-5.8.5-x86_64-AMD_Ryzen_5_3600_6-Core_Processor-with-gentoo-2.7
KiB Mem:    32893472 total,  25434440 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of repository gentoo: Mon, 31 Aug 2020 05:30:01 +0000
Head commit of repository gentoo: 018d11ccfeece021db39dcb63dcd5cae90dd1a07
Timestamp of repository jm-overlay: Sun, 30 Aug 2020 16:36:17 +0000
Head commit of repository jm-overlay: 3aa168664389aec6692a780fea1d0a8f6f7e61dd

Timestamp of repository pf4public: Sun, 30 Aug 2020 22:05:21 +0000
Head commit of repository pf4public: cd4fcd0b691d67189e5f51b959c649bef23334b5

Timestamp of repository rdnetto-overlay: Sun, 30 Aug 2020 14:36:27 +0000
Head commit of repository rdnetto-overlay: c799704bba0ec5c8da33a0619d2cff91e61b811e

Timestamp of repository seden: Sun, 30 Aug 2020 16:36:13 +0000
Head commit of repository seden: 53594a03e0e63f1cdf818500afc6c0b046278d62

Timestamp of repository ssnb: Sun, 30 Aug 2020 16:36:18 +0000
Head commit of repository ssnb: 5b92b6d4b8e2fdfbf62da5170acf68040b843ab0

Timestamp of repository thegreatmcpain: Sat, 29 Aug 2020 23:05:13 +0000
Head commit of repository thegreatmcpain: 75de4d063520b6f04fa4b6e6dc52f41c006dc7d2

Head commit of repository flatpak-overlay: 26c396aef4d2f8908eea9b3ad2ccf7dc843a0887

sh bash 5.0_p18
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r1::gentoo, 3.7.8-r2::gentoo, 3.8.5::gentoo
dev-util/cmake:           3.16.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.31-r6::gentoo
Repositories:

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

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

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

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

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

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

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

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo
    priority: 10

flatpak-overlay
    location: /var/lib/flatpak-overlay
    sync-type: git
    sync-uri: https://github.com/fosero/flatpak-overlay.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /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"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
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"
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 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"
GENTOO_MIRRORS="rsync://ftp.fi.muni.cz/pub/linux/gentoo/ rsync://mirror.dkm.cz/gentoo/ http://gentoo.mirror.web4u.cz/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j12"
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="X acl amd64 berkdb bzip2 cli corefonts crypt dri elogind flac fontconfig fortran gdbm gtk iconv infinality ipv6 jpeg libglvnd libtirpc multilib ncurses nls nptl openmp opus pam pcre png pulseaudio readline seccomp split-usr ssl tcpd truetype unicode vaapi vdpau xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2018" 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="mmx mmxext sse sse2" 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" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Ro Man 2020-08-31 06:48:05 UTC
After playing around, it now seems to me, that the chrony daemon crashes even with rtcsync directive disabled.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2020-08-31 07:56:18 UTC
(In reply to Ro Man from comment #3)
> After playing around, it now seems to me, that the chrony daemon crashes
> even with rtcsync directive disabled.

You'll have to keep playing around, then.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2020-08-31 08:07:57 UTC
       -F level
           This option configures a system call filter when chronyd is
           compiled with support for the Linux secure computing (seccomp)
           facility. In level 1 the process is killed when a forbidden system
           call is made, in level -1 the SIGSYS signal is thrown instead and
           in level 0 the filter is disabled (default 0).


In /etc/conf.d/chrony this is set to '1' not '0'. Does it help your case to set the default there?
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2020-08-31 08:36:12 UTC
Yes, it looks like a random passer-by enabled that, but it is also enabled by default in examples/chronyd.service, so that might explain the mistake (but not the lack of actual testing).
Comment 7 Larry the Git Cow gentoo-dev 2020-08-31 08:40:00 UTC
The bug has been referenced in the following commit(s):

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

commit 6fbce4846282a2d77a9a8094e3d2fcd7176afcd6
Author:     Jeroen Roovers <jer@gentoo.org>
AuthorDate: 2020-08-31 08:35:47 +0000
Commit:     Jeroen Roovers <jer@gentoo.org>
CommitDate: 2020-08-31 08:39:58 +0000

    net-misc/chrony: Disable non-default seccomp filter option
    
    With `-F 1' chronyd sets up a syscall filter and has itself killed when
    a "forbidden" syscall is made. Since we cannot control that (as
    explained in the chronyd(8) manual) we should disable the filter by
    default.
    
    Package-Manager: Portage-3.0.4, Repoman-3.0.1
    Bug: https://bugs.gentoo.org/739714
    Signed-off-by: Jeroen Roovers <jer@gentoo.org>

 net-misc/chrony/chrony-3.5.1-r1.ebuild | 11 ++++++-----
 net-misc/chrony/chrony-4.0_pre3.ebuild | 11 ++++++-----
 net-misc/chrony/chrony-9999.ebuild     | 11 ++++++-----
 net-misc/chrony/files/chronyd.conf-r1  |  2 +-
 4 files changed, 19 insertions(+), 16 deletions(-)
Comment 8 Ro Man 2020-08-31 08:48:10 UTC
(In reply to Jeroen Roovers from comment #5)
> 
> In /etc/conf.d/chrony this is set to '1' not '0'. Does it help your case to
> set the default there?

Changing /etc/conf.d/chrony to using -F 0 helps. It doesn't crash anymore.
Comment 9 Ro Man 2020-08-31 09:09:03 UTC
Thanks very much for very quick fix!
Comment 10 Larry the Git Cow gentoo-dev 2020-09-02 15:51:39 UTC
The bug has been referenced in the following commit(s):

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

commit f7179379b3d676aab1cd6eceafd28145bfed2ae1
Author:     Jeroen Roovers <jer@gentoo.org>
AuthorDate: 2020-09-02 15:50:50 +0000
Commit:     Jeroen Roovers <jer@gentoo.org>
CommitDate: 2020-09-02 15:51:37 +0000

    net-misc/chrony: Simplify setting systemd default options
    
    Package-Manager: Portage-3.0.5, Repoman-3.0.1
    Bug: https://bugs.gentoo.org/show_bug.cgi?id=739714
    Fixes: 6fbce4846282a2d77a9a8094e3d2fcd7176afcd6
    Signed-off-by: Jeroen Roovers <jer@gentoo.org>

 net-misc/chrony/chrony-3.5.1-r1.ebuild                   | 14 +++++---------
 net-misc/chrony/chrony-4.0_pre3.ebuild                   | 14 +++++---------
 net-misc/chrony/chrony-9999.ebuild                       | 14 +++++---------
 net-misc/chrony/files/chrony-3.5-r3-systemd-gentoo.patch |  2 +-
 4 files changed, 16 insertions(+), 28 deletions(-)