systemd/245.4-4ubuntu3.6 ADT test failure with linux-hwe-5.11/5.11.0-20.21~20.04.1

Bug #1933090 reported by Kleber Sacilotto de Souza
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux-hwe-5.11 (Ubuntu)
Won't Fix
Undecided
Unassigned
Focal
Won't Fix
Undecided
Unassigned
linux-hwe-5.15 (Ubuntu)
Invalid
Undecided
Unassigned
Focal
Invalid
Undecided
Unassigned
systemd (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Low
Unassigned

Bug Description

[SRU Impact]

Sysctl was removed from 5.5 kernels. In src/test/test-seccomp.c, test_protect_syscall
sysctl is called with the expectation the error result is EFAULT and not ENOSYS.
This affects autotests for all focal-5.15 linux kernels (hwe, azure, gcp, oem, gke, oracle).

[Fix]
Assertion checks if either EFAULT or ENOSYS is returned. This way it will work for focal-5.4 kernels and focal-5.15 kernels.

[Test to reproduce the issue]
1. Create a vm and install one of the focal-5.15 kernels (i.e 5.15.0-1029.35~20.04.1 linux-oracle-5.15).
2. Run the autotests for upstream and/or root-unittests:
autopkgtest --test-name=upstream systemd -- qemu <vm_image>

[Test to verify the fix]
1. Same as above
2. Apply the fix in your local repo and run the tests using your local repo
autopkgtest --test-name=upstream <path to systemd> -- qemu <vm_image>

[Where problems could occur]
This is not gonna affect end users since it is a change in the test only.
It may impact autotests, but it's a very low probability.

[Original Description]

This is a scripted bug report about ADT failures while running systemd tests for linux-hwe-5.11/5.11.0-20.21~20.04.1 on focal. Whether this is caused by the dep8 tests of the tested source or the kernel has yet to be determined.

Testing failed on:
    amd64: https://autopkgtest.ubuntu.com/results/autopkgtest-focal/focal/amd64/s/systemd/20210611_220645_bf5b6@/log.gz
    armhf: https://autopkgtest.ubuntu.com/results/autopkgtest-focal/focal/armhf/s/systemd/20210617_124738_5b554@/log.gz
    ppc64el: https://autopkgtest.ubuntu.com/results/autopkgtest-focal/focal/ppc64el/s/systemd/20210611_235629_92856@/log.gz
    s390x: https://autopkgtest.ubuntu.com/results/autopkgtest-focal/focal/s390x/s/systemd/20210611_214456_6427f@/log.gz

In arm64, ppc64el and s390x, 'root-unittests' fails with:

/* test_protect_sysctl */
Assertion 'errno == EFAULT' failed at src/test/test-seccomp.c:311, function test_protect_sysctl(). A
borting.
sysctlseccomp terminated by signal ABRT.
Assertion 'wait_for_terminate_and_check("sysctlseccomp", pid, WAIT_LOG) == EXIT_SUCCESS' failed at s
rc/test/test-seccomp.c:324, function test_protect_sysctl(). Aborting.
FAIL: test-seccomp (code: 134)

In amd64, 'upstream' also fails on 'TEST-24-UNIT-TESTS', which apparently is caused by the same 'test-seccomp.c:311' assertion failure.

Related branches

tags: added: kernel-adt-failure
Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :

The tests actually ran with systemd/245.4-4ubuntu3.6 and not with systemd/245.4-4ubuntu3.7. We are having some issues with the hwe-5.11 meta packages which caused the tests with 3.7 to be run with the wrong kernel.

description: updated
summary: - systemd/245.4-4ubuntu3.7 ADT test failure with linux-
+ systemd/245.4-4ubuntu3.6 ADT test failure with linux-
hwe-5.11/5.11.0-20.21~20.04.1
Changed in linux-hwe-5.11 (Ubuntu):
status: New → Won't Fix
Changed in linux-hwe-5.11 (Ubuntu Focal):
status: New → Won't Fix
Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :
Revision history for this message
Roxana Nicolescu (roxanan) wrote :

Still failing in Focal, for linux-oracle-5.15 this time. And it's been failing for some time now
https://autopkgtest.ubuntu.com/results/autopkgtest-focal/focal/amd64/s/systemd/20221206_050631_237a8@/log.gz

Revision history for this message
Roxana Nicolescu (roxanan) wrote :

I run the test locally on a vm running linux-oracle-5.15-1029.
It seems `syscall(__NR__sysctl, NULL)` returns ENOSYS(38) -- Function not implemented.
Checking `/proc/kallsyms` it seems sysctl is not implemented indeed.

If I take a closer look at jammy-ubuntu tag in systemd source (test that is not failing currently)
I can see that it asserts for either EFAULT or ENOSYS:

assert_se(IN_SET(errno, EFAULT, ENOSYS));

This patch will solve the issue:

diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c
index 67900d85e..7ebcca4d3 100644
--- a/src/test/test-seccomp.c
+++ b/src/test/test-seccomp.c
@@ -307,7 +307,7 @@ static void test_protect_sysctl(void) {
         if (pid == 0) {
 #if defined __NR__sysctl && __NR__sysctl >= 0
                 assert_se(syscall(__NR__sysctl, NULL) < 0);
- assert_se(errno == EFAULT);
+ assert_se(IN_SET(errno, EFAULT, ENOSYS));
 #endif

                 assert_se(seccomp_protect_sysctl() >= 0);

Revision history for this message
Roxana Nicolescu (roxanan) wrote :

Fyi sysctl syscall was completely removed in 5.5 (88db0aa2421666d2f73486d15b239a4521983d55).

Revision history for this message
Roxana Nicolescu (roxanan) wrote :
Nick Rosbrook (enr0n)
Changed in systemd (Ubuntu Focal):
status: New → Triaged
importance: Undecided → Low
Changed in systemd (Ubuntu):
status: New → Fix Released
Changed in linux-hwe-5.15 (Ubuntu):
status: New → Invalid
Changed in linux-hwe-5.15 (Ubuntu Focal):
status: New → Invalid
Nick Rosbrook (enr0n)
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Kleber, or anyone else affected,

Accepted systemd into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/245.4-4ubuntu3.21 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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 Focal):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Roxana Nicolescu (roxanan) wrote (last edit ):
tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
tags: added: sru-20230227 sru-20230320
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/245.4-4ubuntu3.21)

All autopkgtests for the newly accepted systemd (245.4-4ubuntu3.21) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

apt/2.0.9 (armhf)
bilibop/unknown (s390x)
freeipa/unknown (s390x)
fwupd/1.7.9-1~20.04.1 (armhf)
libsoup2.4/2.70.0-1 (s390x)
libusb-1.0/unknown (s390x)
libvirt/unknown (s390x)
linux-aws-5.11/blacklisted (amd64, arm64)
linux-aws-5.13/blacklisted (amd64, arm64)
linux-aws-5.15/5.15.0-1033.37~20.04.1 (arm64)
linux-aws-5.15/unknown (amd64)
linux-aws-5.8/blacklisted (amd64)
linux-azure-5.11/blacklisted (amd64, arm64)
linux-azure-5.13/blacklisted (arm64)
linux-azure-5.8/blacklisted (amd64)
linux-azure-cvm/5.4.0-1105.111+cvm1 (amd64)
linux-gcp-5.11/blacklisted (amd64)
linux-gcp-5.13/blacklisted (amd64)
linux-gcp-5.15/5.15.0-1030.37~20.04.1 (amd64)
linux-gcp-5.15/5.15.0-1031.38~20.04.1 (arm64)
linux-gcp-5.8/blacklisted (amd64)
linux-gke-5.15/5.15.0-1029.34~20.04.1 (amd64, arm64)
linux-gkeop-5.15/5.15.0-1016.21~20.04.1 (amd64)
linux-hwe-5.11/blacklisted (amd64, arm64, armhf, ppc64el, s390x)
linux-hwe-5.13/blacklisted (amd64, arm64, armhf, ppc64el, s390x)
linux-hwe-5.15/5.15.0-69.76~20.04.1 (amd64, armhf)
linux-hwe-5.8/blacklisted (amd64, arm64, ppc64el, s390x)
linux-ibm/5.4.0-1046.51 (amd64)
linux-intel-5.13/blacklisted (amd64)
linux-intel-iotg-5.15/5.15.0-1027.32~20.04.1 (amd64)
linux-oem-5.10/blacklisted (amd64)
linux-oem-5.13/blacklisted (amd64)
linux-oem-5.14/5.14.0-1059.67 (amd64)
linux-oem-5.6/blacklisted (amd64)
linux-oracle-5.11/blacklisted (amd64)
linux-oracle-5.13/blacklisted (amd64, arm64)
munin/2.0.56-1ubuntu1 (arm64, ppc64el)
pdns-recursor/unknown (s390x)
php7.4/unknown (s390x)
polkit-qt-1/unknown (s390x)
puppet/5.5.10-4ubuntu3 (s390x)
tinyssh/unknown (s390x)
udisks2/2.8.4-1ubuntu2 (amd64)
upower/0.99.11-1build2 (s390x)

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/focal/update_excuses.html#systemd

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

Thank you!

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

This bug was fixed in the package systemd - 245.4-4ubuntu3.21

---------------
systemd (245.4-4ubuntu3.21) focal; urgency=medium

  * udev: avoid NIC renaming race with kernel (LP: #2002445)
    Files:
    - debian/patches/lp2002445-netlink-do-not-fail-when-new-interface-name-is-already-us.patch
    - debian/patches/lp2002445-netlink-introduce-rtnl_get-delete_link_alternative_names.patch
    - debian/patches/lp2002445-sd-netlink-restore-altname-on-error-in-rtnl_set_link_name.patch
    - debian/patches/lp2002445-udev-attempt-device-rename-even-if-interface-is-up.patch
    - debian/patches/lp2002445-udev-net-allow-new-link-name-as-an-altname-before-renamin.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=69ab4a02e828e20ea0ddbd75179324df7a8d1175
  * test-seccomp: accept ENOSYS from sysctl(2) too (LP: #1933090)
    Thanks to Roxana Nicolescu
    File: debian/patches/lp1933090-test-seccomp-accept-ENOSYS-from-sysctl-2-too.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=adaddd1441370ebcdb8bc33d7406b95d85b744f9
  * debian/test: ignore systemd-remount-fs.service failure in containers (LP: #1991285)
    File: debian/tests/boot-and-services
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=264bdc86f1e4dcd10e8d914d095581c54c33199a

 -- Nick Rosbrook <email address hidden> Wed, 15 Mar 2023 11:04:15 -0400

Changed in systemd (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) 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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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