Unable to build sysdig module on 5.0 kernels

Bug #1826845 reported by Po-Hsu Lin on 2019-04-29
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
Undecided
Sean Feole
sysdig (Ubuntu)
Medium
Connor Kuehl
Bionic
Medium
Unassigned

Bug Description

[ Impact ]

 * The DKMS package fails to install on 5.0 kernels.

[ Test Case ]

 * Install the 'sysdig-dkms' package. It should build and install without any compilation failures.

[ Proposed Fix ]

 * Port the following patches:
   - https://github.com/draios/sysdig/commit/2c8f0263382bf64800faec5fba5cc3e005d9fb1e.patch
   - https://github.com/draios/sysdig/commit/3248bf70d677abe6f60bb9f8275a774600ed77e8.patch

Note: No real context adjustments required, offset updates were required to apply the patch to fixup the syscall table; "quilt refresh" updated offsets on the patch that was already in the package.

[ Regression Potential ]

 * Low. These changes are conditionally compiled.

[ Testing ]

The following instructions were used to test these changes on the 4.15 kernel that Bionic 18.04 ships with as well as the 5.0 kernel that is included in the HWE edge package on an amd64 environment.

- Create a Bionic 18.04 VM
- Enable the "-proposed" repository and install the linux-generic-hwe-18.04-edge package or install the .debs from here: https://launchpad.net/~canonical-kernel-team/+archive/ubuntu/ppa/+packages?field.name_filter=linux-hwe-edge&field.status_filter=published&field.series_filter=bionic
- Install "sysdig-dkms" and confirm that installation fails because the module cannot be compiled
- Remove the failed install "sudo apt remove sysdig-dkms"
- Pull the sources with "pull-lp-source sysdig bionic"
- Apply the debdiff with "debdiff-apply < path-to-file.debdiff"
- Build the package with "debuild -b -uc -us"
- Install the package produced from the previous step with "sudo dpkg -i path-to-file.deb"
- Verify the installation completed successfully. You can also check to see if it appears with "sudo dkms status"

---

ubuntu_sysdig_smoke_test failed because the module cannot be built on Bionic 5.0.0 kernel:

 Error! Bad return status for module build on kernel: 5.0.0-13-generic (x86_64)
 Consult /var/lib/dkms/sysdig/0.19.1/build/make.log for more information.
 Setting up libjsoncpp1:amd64 (1.7.4-3) ...
 Setting up sysdig (0.19.1-1ubuntu1) ...
 Processing triggers for libc-bin (2.27-3ubuntu1) ...
'dkms status -m sysdig | grep installed'
'cat /var/lib/dkms/sysdig/*/build/make.log'
 DKMS make.log for sysdig-0.19.1 for kernel 5.0.0-13-generic (x86_64)
 Thu Apr 25 14:14:16 UTC 2019
 make: Entering directory '/usr/src/linux-headers-5.0.0-13-generic'
 CC [M] /var/lib/dkms/sysdig/0.19.1/build/main.o
 CC [M] /var/lib/dkms/sysdig/0.19.1/build/dynamic_params_table.o
 CC [M] /var/lib/dkms/sysdig/0.19.1/build/flags_table.o
 CC [M] /var/lib/dkms/sysdig/0.19.1/build/ppm_events.o
 CC [M] /var/lib/dkms/sysdig/0.19.1/build/ppm_fillers.o
 CC [M] /var/lib/dkms/sysdig/0.19.1/build/event_table.o
 CC [M] /var/lib/dkms/sysdig/0.19.1/build/syscall_table.o
 CC [M] /var/lib/dkms/sysdig/0.19.1/build/ppm_cputime.o
 /var/lib/dkms/sysdig/0.19.1/build/main.c: In function ‘page_fault_probe’:
 /var/lib/dkms/sysdig/0.19.1/build/main.c:2045:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
 struct event_data_t event_data;
 ^~~~~~
 /var/lib/dkms/sysdig/0.19.1/build/ppm_events.c: In function ‘ppm_copy_from_user’:
 /var/lib/dkms/sysdig/0.19.1/build/ppm_events.c:99:48: error: macro "access_ok" passed 3 arguments, but takes just 2
 if (likely(ppm_access_ok(VERIFY_READ, from, n)))
 ^
 In file included from ./include/linux/export.h:45:0,
 from ./include/linux/linkage.h:7,
 from ./arch/x86/include/asm/cache.h:5,
 from ./include/linux/cache.h:6,
 from ./include/linux/time.h:5,
 from ./include/linux/compat.h:10,
 from /var/lib/dkms/sysdig/0.19.1/build/ppm_events.c:21:
 /var/lib/dkms/sysdig/0.19.1/build/ppm_events.c:59:23: error: ‘access_ok’ undeclared (first use in this function); did you mean ‘access_flags’?
 #define ppm_access_ok access_ok
 ^
 ./include/linux/compiler.h:76:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
 ^
 /var/lib/dkms/sysdig/0.19.1/build/ppm_events.c:99:13: note: in expansion of macro ‘ppm_access_ok’
 if (likely(ppm_access_ok(VERIFY_READ, from, n)))
 ^~~~~~~~~~~~~
 /var/lib/dkms/sysdig/0.19.1/build/ppm_events.c:59:23: note: each undeclared identifier is reported only once for each function it appears in
 #define ppm_access_ok access_ok
 ^
 ./include/linux/compiler.h:76:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
 ^
 /var/lib/dkms/sysdig/0.19.1/build/ppm_events.c:99:13: note: in expansion of macro ‘ppm_access_ok’
 if (likely(ppm_access_ok(VERIFY_READ, from, n)))
 ^~~~~~~~~~~~~
 /var/lib/dkms/sysdig/0.19.1/build/ppm_events.c: In function ‘ppm_strncpy_from_user’:
 /var/lib/dkms/sysdig/0.19.1/build/ppm_events.c:130:54: error: macro "access_ok" passed 3 arguments, but takes just 2
 if (!ppm_access_ok(VERIFY_READ, from, bytes_to_read)) {
 ^
 /var/lib/dkms/sysdig/0.19.1/build/ppm_events.c:59:23: error: ‘access_ok’ undeclared (first use in this function); did you mean ‘access_flags’?
 #define ppm_access_ok access_ok
 ^
 /var/lib/dkms/sysdig/0.19.1/build/ppm_events.c:130:8: note: in expansion of macro ‘ppm_access_ok’
 if (!ppm_access_ok(VERIFY_READ, from, bytes_to_read)) {
 ^~~~~~~~~~~~~
 scripts/Makefile.build:284: recipe for target '/var/lib/dkms/sysdig/0.19.1/build/ppm_events.o' failed
 make[1]: *** [/var/lib/dkms/sysdig/0.19.1/build/ppm_events.o] Error 1
 make[1]: *** Waiting for unfinished jobs....
 Makefile:1584: recipe for target '_module_/var/lib/dkms/sysdig/0.19.1/build' failed
 make: *** [_module_/var/lib/dkms/sysdig/0.19.1/build] Error 2
 make: Leaving directory '/usr/src/linux-headers-5.0.0-13-generic'

Connor Kuehl (connork) wrote :

.debdiff attached to this comment, adding SRU paperwork to the original bug description.

description: updated
Connor Kuehl (connork) on 2019-05-14
description: updated
Connor Kuehl (connork) on 2019-05-14
Changed in sysdig (Ubuntu):
assignee: nobody → Connor Kuehl (connork)
status: New → In Progress

The attachment "sysdig_0.19.1-1ubuntu1.1.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Connor Kuehl (connork) on 2019-05-16
description: updated
no longer affects: linux-hwe-edge (Ubuntu)
Changed in sysdig (Ubuntu):
importance: Undecided → Medium
Sean Feole (sfeole) wrote :

affects 5.0.0-1008.9 linux-oem-osp1

summary: - Unable to build sysdig module on 5.0.0-13.14~18.04.2 linux-hwe-edge
- kernel
+ Unable to build sysdig module on 5.0 kernels
tags: added: linux-oem-osp1
tags: added: amd64
tags: added: 5.0
Changed in ubuntu-kernel-tests:
status: New → Confirmed
tags: added: linux-hwe-edge

Hello Po-Hsu, or anyone else affected,

Accepted sysdig into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sysdig/0.19.1-1ubuntu1.1 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 sysdig (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-bionic
Łukasz Zemczak (sil2100) wrote :

Also, this seems to be Fix Released in eoan, am I right?

Po-Hsu Lin (cypressyew) wrote :

Work with B-hwe 5.0 on Bionic.

tags: added: verification-done-bionic
removed: verification-needed-bionic
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sysdig - 0.19.1-1ubuntu1.1

---------------
sysdig (0.19.1-1ubuntu1.1) bionic; urgency=medium

  * Fix build for Linux 5.0 (LP: #1826845)
    - debian/patches/0001-Update-for-change-to-access_ok-in-Linux-5.0.patch
    - debian/patches/Fix-build-failures-due-to-undefined-syscall-numbers.patch

 -- Connor Kuehl <email address hidden> Tue, 14 May 2019 12:32:24 -0700

Changed in sysdig (Ubuntu Bionic):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for sysdig has completed successfully and the package has now been 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.

Mathew Hodson (mathew-hodson) wrote :

Same patches were also applied to Disco
---

sysdig (0.24.1-1ubuntu2) disco; urgency=medium

  * Add patch to fix build errors on arm64

 -- Seth Forshee <email address hidden> Thu, 14 Feb 2019 10:05:34 -0600

sysdig (0.24.1-1ubuntu1) disco; urgency=medium

  * Add patch to fix build errors with Linux 5.0 caused by change to
    access_ok macro (LP: #1813069)
  * Refresh patches to clean up hunk offset warnings

 -- Colin Ian King <email address hidden> Thu, 31 Jan 2019 11:04:11 +0100

Changed in sysdig (Ubuntu Bionic):
importance: Undecided → Medium
Changed in sysdig (Ubuntu):
status: In Progress → Fix Released
Sean Feole (sfeole) on 2019-08-29
Changed in ubuntu-kernel-tests:
status: Confirmed → Fix Released
assignee: nobody → Sean Feole (sfeole)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers