systemd crashes when logging long message

Bug #1860548 reported by Ioanna Alifieraki
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
Medium
Ioanna Alifieraki
Bionic
Fix Released
Medium
Ioanna Alifieraki
Disco
Fix Released
Undecided
Unassigned
Eoan
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

Systemd crashes when logging very long messages. This regression was introduced with
upstream commit d054f0a4d451 [1] due to xsprintf.
Commits e68eedbbdc98 [2] and 574432f889ce [3] replace some uses of xsprintf with
snprintf and fix it.

[Test Case]

# systemd-run --scope apt-get -q -y -o DPkg::Options::=--force-confold -o DPkg::Options::=--force-confdef --allow-unauthenticated install acl adduser amd64-microcode apt base-files base-passwd bash bash-completion bind9-host binfmt-support binutils-common binutils-x86-64-linux-gnu bsdmainutils bsdutils busybox-initramfs busybox-static bzip2 ca-certificates console-setup console-setup-linux coreutils cpio cpp cpp-7 crda cron curl dash dbus dctrl-tools debconf debconf-i18n debianutils dictionaries-common diffutils dirmngr distro-info-data dmeventd dmsetup dnsmasq-base dnsutils dpkg e2fslibs e2fsprogs ed eject fakeroot fdisk file findutils friendly-recovery gawk gcc-7-base gcc-8-base gettext-base gir1.2-glib-2.0 gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv grep groff-base grub-common grub-pc grub-pc-bin grub2-common gzip hostname info init init-system-helpers initramfs-tools initramfs-tools-bin initramfs-tools-core install-info intel-microcode iproute2 iptables iputils-ping iputils-tracepath irqbalance isc-dhcp-client isc-dhcp-common iso-codes iw keyboard-configuration keyutils klibc-utils kmod krb5-locales krb5-user language-pack-en language-pack-en-base language-pack-gnome-en language-pack-gnome-en-base less libaccountsservice0 libacl1 libapparmor1 libargon2-0 libasan4 libasn1-8-heimdal libassuan0 libatm1 libatomic1 libattr1 libaudit-common libaudit1 libbinutils libblkid1 libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc6 libc6-dev libcap-ng0 libcap2 libcap2-bin libcc1-0 libcilkrts5 libcom-err2 libcryptsetup12 libcurl3-gnutls libcurl4 libdb5.3 libdbus-1-3 libdebconfclient0 libdevmapper-event1.02.1 libdevmapper1.02.1 libdpkg-perl libdrm-common libdrm2 libdumbnet1 libedit2 libelf1 libestr0 libevent-2.1-6 libexpat1 libexpat1-dev libext2fs2 libfakeroot libfastjson4 libfdisk1 libffi6 libfreetype6 libfribidi0 libfuse2 libgc1c2 libgcc-7-dev libgcc1 libgcrypt20 libgdbm-compat4 libgeoip1 libgirepository-1.0-1 libglib2.0-0 libglib2.0-data libgmp10 libgnutls30 libgomp1 libgpg-error0 libgpm2 libgssapi-krb5-2 libgssapi3-heimdal libgssrpc4 libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhogweed4 libhx509-5-heimdal libitm1 libjs-jquery libjs-sphinxdoc libjs-underscore libk5crypto3 libkadm5clnt-mit11 libkadm5srv-mit11 libkdb5-9 libkeyutils1 libkmod2 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libksba8 libldap-2.4-2 libldap-common liblocale-gettext-perl liblsan0 liblz4-1 liblzma5 libmagic-mgc libmagic1 libmnl0 libmount1 libmpc3 libmpdec2 libmpfr6 libmpx2 libmspack0 libncurses5 libncursesw5 libnetfilter-conntrack3 libnettle6 libnewt0.52 libnfnetlink0 libnfsidmap2 libnghttp2-14 libnl-3-200 libnl-genl-3-200 libnorm1 libnpth0 libnss-systemd libnuma1 libp11-kit0 libpam-cap libpam-krb5 libpam-modules libpam-modules-bin libpam-runtime libpam-systemd libpam0g libparted2 libpcap0.8 libpci3 libpcre3 libpgm-5.2-0 libpipeline1 libplymouth4 libpng16-16 libpolkit-gobject-1-0 libpopt0 libpsl5 libpython-all-dev libpython-dev libpython-stdlib libpython2.7 libpython2.7-dev libpython2.7-minimal

# tail -f /var/log/syslog
...
Jan 22 12:50:33 bionic-kernel systemd[1]: Assertion 'xsprintf: buf[] must be big enough' failed at ../src/core/job.c:803, function job_log_status_message(). Aborting.

Broadcast message from systemd-journald@bionic-kernel (Wed 2020-01-22 12:50:33 UTC):

systemd[1]: Caught <ABRT>, dumped core as pid 14620.

Broadcast message from systemd-journald@bionic-kernel (Wed 2020-01-22 12:50:33 UTC):

systemd[1]: Freezing execution.

Jan 22 12:50:33 bionic-kernel systemd[1]: Caught <ABRT>, dumped core as pid 14620.
Jan 22 12:50:33 bionic-kernel systemd[1]: Freezing execution.

[Regression Potential]

The patches replace xsprintf with snprintf and the regression potential is small.

Any regression would likely involve additional systemd crashes and/or truncated log/output messages.

[Other]

Only Bionic is affected.

[1] https://github.com/systemd/systemd/issues/4534
[2] https://github.com/systemd/systemd/commit/e68eedbbdc98fa13449756b7fee3bed689d76493
[3] https://github.com/systemd/systemd/commit/574432f889ce3de126bbc6736bcbd22ee170ff82

Changed in systemd (Ubuntu Bionic):
status: New → Confirmed
Changed in systemd (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Changed in systemd (Ubuntu Bionic):
importance: Undecided → Medium
assignee: nobody → Ioanna Alifieraki (joalif)
Changed in systemd (Ubuntu):
assignee: nobody → Ioanna Alifieraki (joalif)
Balint Reczey (rbalint)
Changed in systemd (Ubuntu Disco):
status: New → Fix Released
Changed in systemd (Ubuntu Eoan):
status: New → Fix Released
Changed in systemd (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Ioanna Alifieraki (joalif) wrote :
tags: added: sts sts-sponsor-ddstreet
Dan Streetman (ddstreet)
tags: added: ddstreet-next
Dan Streetman (ddstreet)
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Ioanna, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.34 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Bionic):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/237-3ubuntu10.34)

All autopkgtests for the newly accepted systemd (237-3ubuntu10.34) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

php7.2/7.2.24-0ubuntu0.18.04.2 (armhf)
openssh/1:7.6p1-4ubuntu0.3 (arm64, armhf, ppc64el, amd64, s390x, i386)
dovecot/1:2.2.33.2-1ubuntu4.5 (armhf)
gvfs/1.36.1-0ubuntu1.3.3 (ppc64el)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#systemd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Ioanna Alifieraki (joalif) wrote :
Download full text (3.9 KiB)

VERIFICATION ON BIONIC

Installed systemd from -proposed :
# dpkg -l | grep systemd
ii libnss-systemd:amd64 237-3ubuntu10.34 amd64 nss module providing dynamic user and group name resolution
ii libsystemd0:amd64 237-3ubuntu10.34 amd64 systemd utility library
ii python3-systemd 234-1build1 amd64 Python 3 bindings for systemd
ii systemd 237-3ubuntu10.34 amd64 system and service manager
ii systemd-sysv 237-3ubuntu10.34 amd64 system and service manager - SysV links

Following the reproducer described in the [Test Case] section of the bug description :

# systemd-run --scope apt-get -q -y -o DPkg::Options::=--force-confold -o DPkg::Options::=--force-confdef --allow-unauthenticated install acl adduser amd64-microcode apt base-files base-passwd bash bash-completion bind9-host binfmt-support binutils-common binutils-x86-64-linux-gnu bsdmainutils bsdutils busybox-initramfs busybox-static bzip2 ca-certificates console-setup console-setup-linux coreutils cpio cpp cpp-7 crda cron curl dash dbus dctrl-tools debconf debconf-i18n debianutils dictionaries-common diffutils dirmngr distro-info-data dmeventd dmsetup dnsmasq-base dnsutils dpkg e2fslibs e2fsprogs ed eject fakeroot fdisk file findutils friendly-recovery gawk gcc-7-base gcc-8-base gettext-base gir1.2-glib-2.0 gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv grep groff-base grub-common grub-pc grub-pc-bin grub2-common gzip hostname info init init-system-helpers initramfs-tools initramfs-tools-bin initramfs-tools-core install-info intel-microcode iproute2 iptables iputils-ping iputils-tracepath irqbalance isc-dhcp-client isc-dhcp-common iso-codes iw keyboard-configuration keyutils klibc-utils kmod krb5-locales krb5-user language-pack-en language-pack-en-base language-pack-gnome-en language-pack-gnome-en-base less libaccountsservice0 libacl1 libapparmor1 libargon2-0 libasan4 libasn1-8-heimdal libassuan0 libatm1 libatomic1 libattr1 libaudit-common libaudit1 libbinutils libblkid1 libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc6 libc6-dev libcap-ng0 libcap2 libcap2-bin libcc1-0 libcilkrts5 libcom-err2 libcryptsetup12 libcurl3-gnutls libcurl4 libdb5.3 libdbus-1-3 libdebconfclient0 libdevmapper-event1.02.1 libdevmapper1.02.1 libdpkg-perl libdrm-common libdrm2 libdumbnet1 libedit2 libelf1 libestr0 libevent-2.1-6 libexpat1 libexpat1-dev libext2fs2 libfakeroot libfastjson4 libfdisk1 libffi6 libfreetype6 libfribidi0 libfuse2 libgc1c2 libgcc-7-dev libgcc1 libgcrypt20 libgdbm-compat4 libgeoip1 libgirepository-1.0-1 libglib2.0-0 libglib2.0-data libgmp10 libgnutls30 libgomp1 libgpg-error0 libgpm2 libgssapi-krb5-2 libgssapi3-heimdal libgssrpc4 libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhogweed4 libhx509-5-heimdal libitm1 libjs-jquery libjs-sphinxdoc libjs-underscore libk5crypto3 libkadm5clnt-mit11 libkadm5srv-mit11 libkdb5-9 libkeyutils1 libkmod...

Read more...

tags: added: verification-done-bionic
removed: verification-needed-bionic
tags: added: verification-done
removed: verification-needed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

This SRU needs to be reuploaded, due to security update that trumped this in progress SRU.

Changed in systemd (Ubuntu Bionic):
status: Fix Committed → In Progress
tags: added: verification-failed verification-failed-bionic
removed: verification-done verification-done-bionic
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Ioanna, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.39 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
removed: verification-failed verification-failed-bionic
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/237-3ubuntu10.39)

All autopkgtests for the newly accepted systemd (237-3ubuntu10.39) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

php7.2/7.2.24-0ubuntu0.18.04.2 (armhf)
gvfs/1.36.1-0ubuntu1.3.3 (ppc64el)
lxc/3.0.3-0ubuntu1~18.04.1 (amd64)
systemd/237-3ubuntu10.39 (i386)
netplan.io/0.98-0ubuntu1~18.04.1 (i386, amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#systemd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Ioanna Alifieraki (joalif) wrote :
Download full text (4.0 KiB)

RE-VERIFICATION ON BIONIC

Installed systemd from -proposed :
# dpkg -l | grep systemd
ii libnss-systemd:amd64 237-3ubuntu10.39 amd64 nss module providing dynamic user and group name resolution
ii libpam-systemd:amd64 237-3ubuntu10.39 amd64 system and service manager - PAM module
ii libsystemd0:amd64 237-3ubuntu10.39 amd64 systemd utility library
ii python3-systemd 234-1build1 amd64 Python 3 bindings for systemd
ii systemd 237-3ubuntu10.39 amd64 system and service manager
ii systemd-sysv 237-3ubuntu10.39 amd64 system and service manager - SysV links

Following the reproducer described in the [Test Case] section of the bug description :

# systemd-run --scope apt-get -q -y -o DPkg::Options::=--force-confold -o DPkg::Options::=--force-confdef --allow-unauthenticated install acl adduser amd64-microcode apt base-files base-passwd bash bash-completion bind9-host binfmt-support binutils-common binutils-x86-64-linux-gnu bsdmainutils bsdutils busybox-initramfs busybox-static bzip2 ca-certificates console-setup console-setup-linux coreutils cpio cpp cpp-7 crda cron curl dash dbus dctrl-tools debconf debconf-i18n debianutils dictionaries-common diffutils dirmngr distro-info-data dmeventd dmsetup dnsmasq-base dnsutils dpkg e2fslibs e2fsprogs ed eject fakeroot fdisk file findutils friendly-recovery gawk gcc-7-base gcc-8-base gettext-base gir1.2-glib-2.0 gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv grep groff-base grub-common grub-pc grub-pc-bin grub2-common gzip hostname info init init-system-helpers initramfs-tools initramfs-tools-bin initramfs-tools-core install-info intel-microcode iproute2 iptables iputils-ping iputils-tracepath irqbalance isc-dhcp-client isc-dhcp-common iso-codes iw keyboard-configuration keyutils klibc-utils kmod krb5-locales krb5-user language-pack-en language-pack-en-base language-pack-gnome-en language-pack-gnome-en-base less libaccountsservice0 libacl1 libapparmor1 libargon2-0 libasan4 libasn1-8-heimdal libassuan0 libatm1 libatomic1 libattr1 libaudit-common libaudit1 libbinutils libblkid1 libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc6 libc6-dev libcap-ng0 libcap2 libcap2-bin libcc1-0 libcilkrts5 libcom-err2 libcryptsetup12 libcurl3-gnutls libcurl4 libdb5.3 libdbus-1-3 libdebconfclient0 libdevmapper-event1.02.1 libdevmapper1.02.1 libdpkg-perl libdrm-common libdrm2 libdumbnet1 libedit2 libelf1 libestr0 libevent-2.1-6 libexpat1 libexpat1-dev libext2fs2 libfakeroot libfastjson4 libfdisk1 libffi6 libfreetype6 libfribidi0 libfuse2 libgc1c2 libgcc-7-dev libgcc1 libgcrypt20 libgdbm-compat4 libgeoip1 libgirepository-1.0-1 libglib2.0-0 libglib2.0-data libgmp10 libgnutls30 libgomp1 libgpg-error0 libgpm2 libgssapi-krb5-2 libgssapi3-heimdal libgssrpc4 libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhogweed4 libhx50...

Read more...

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 237-3ubuntu10.39

---------------
systemd (237-3ubuntu10.39) bionic; urgency=medium

  [ Dariusz Gadomski ]
  * d/p/lp1762391/0001-Call-getgroups-to-know-size-of-supplementary-groups-.patch,
    d/p/lp1762391/0002-user-util-tweak-to-in_gid.patch,
    d/p/lp1762391/0003-user-util-Add-helper-functions-for-gid-lists-operati.patch,
    d/p/lp1762391/0004-execute-Restore-call-to-pam_setcred.patch,
    d/p/lp1762391/0005-execute-Detect-groups-added-by-PAM-and-merge-them-wi.patch,
    d/p/lp1762391/0006-test-Add-tests-for-gid-list-ops.patch,
    d/p/lp1762391/0007-execute-add-const-to-array-parameters-where-possible.patch,
    d/p/lp1762391/0008-execute-allow-pam_setcred-to-fail-ignore-errors.patch:
    - Restore call to pam_setcred (LP: #1762391)

  [ Ioanna Alifieraki ]
  * d/p/lp1860548/0001-Revert-Replace-use-of-snprintf-with-xsprintf.patch,
    d/p/lp1860548/0002-job-truncate-unit-description.patch:
    - use snprintf instead of xsprintf (LP: #1860548)

  [ Dan Streetman ]
  * d/p/lp1833193-network-update-address-when-static-address-was-alrea.patch:
    - Update lft when static addr was cfg by dhcp (LP: #1833193)
  * d/p/lp1849261/0001-core-when-we-can-t-enqueue-OnFailure-job-show-full-e.patch,
    d/p/lp1849261/0002-core-don-t-trigger-OnFailure-deps-when-a-unit-is-goi.patch:
    - Only trigger OnFailure= if Restart= is not in effect (LP: #1849261)
  * d/p/lp1671951-network-set-ipv6-mtu-after-link-up-or-device-mtu-cha.patch:
    - set ipv6 mtu at correct time (LP: #1671951)
  * d/p/lp1845909/0001-networkd-honour-LinkLocalAddressing.patch,
    d/p/lp1845909/0002-networkd-fix-link_up-12505.patch,
    d/p/lp1845909/0003-network-do-not-send-ipv6-token-to-kernel.patch,
    d/p/lp1845909/0004-network-rename-linux_configure_after_setting_mtu-to-linux.patch,
    d/p/lp1845909/0005-network-add-link-setting_genmode-flag.patch,
    d/p/lp1845909/0006-network-if-ipv6ll-is-disabled-enumerate-tentative-ipv6-ad.patch,
    d/p/lp1845909/0007-network-drop-foreign-config-after-addr_gen_mode-has-been-.patch,
    d/p/lp1845909/0008-network-drop-IPv6LL-address-when-LinkLocalAddressing.patch:
    - if LinkLocalAddressing=no prevent creation of ipv6ll (LP: #1845909)
  * d/p/lp1859862-network-Do-not-disable-IPv6-by-writing-to-sysctl.patch:
    - enable ipv6 when needed (LP: #1859862)
  * d/p/lp1836695-networkd-Add-back-static-routes-after-DHCPv4-lease-e.patch:
    - (re)add static routes after getting dhcp4 addr (LP: #1836695)
  * d/t/storage:
    - fix buggy test (LP: #1831459)
    - without scsi_debug, skip test (LP: #1847816)

 -- Dan Streetman <email address hidden> Thu, 06 Feb 2020 10:00:49 -0500

Changed in systemd (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.