seccomp_bpf in seccomp from ubuntu_kernel_selftests failed to build on B-5.4

Bug #1896420 reported by Po-Hsu Lin
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Invalid
Undecided
Unassigned
Focal
Fix Released
Undecided
Luke Nowakowski-Krijger

Bug Description

[Impact]

Test fails to build in selftests/seccomp/seccomp_bpf.c with
'error: storage size of ‘md’ isn’t known' due to the type
struct seccomp_metadata not being defined for B/5.4 kernels.

[Test case]

Test successfully builds and test cases pass both on Bionic/5.4 and on Focal

[Fixes]

Unconditionally define struct seccomp_metadata.
Remove linux/ptrace.h where a definition of seccomp_metadata is already being
defined in Focal.

[Potential regression]

There could be future build failures if glibc headers get updated to
include definitions of struct seccomp_metadata or if linux/ptrace.h gets updated
to include needed definitions.

---------------------------------------------------
Issue found on 5.4.0-48.52~18.04.1

Test build failed with:
 gcc -Wl,-no-as-needed -Wall seccomp_bpf.c -lpthread -o seccomp_bpf
 seccomp_bpf.c: In function ‘get_metadata’:
 seccomp_bpf.c:3028:26: error: storage size of ‘md’ isn’t known
 struct seccomp_metadata md;
 ^~
 seccomp_bpf.c:3028:26: warning: unused variable ‘md’ [-Wunused-variable]
 Makefile:12: recipe for target 'seccomp_bpf' failed

Po-Hsu Lin (cypressyew)
tags: added: 5.4 bionic ubuntu-kernel-selftests
tags: added: kqa-blocker sru-20200831
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

This issue does not exist in Focal 5.4.0-48.52, just 5.4 on Bionic.

Revision history for this message
Thadeu Lima de Souza Cascardo (cascardo) wrote :

I see this happening on ADT. For example, https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-bionic/bionic/amd64/l/linux-hwe-5.4/20200918_130259_40c27@/log.gz.

The only way I see it happening is some header defining PTRACE_SECCOMP_GET_METADATA macro, not struct seccomp_metadata. I don't see that on linux-libc-dev headers for bionic. There is something fishy going on here.

Cascardo.

Revision history for this message
Stefan Bader (smb) wrote :

That might mean the selftest would need to look more for headers in-tree. The libc-dev in Bionic comes from the 4.15 base kernel.

Revision history for this message
Thadeu Lima de Souza Cascardo (cascardo) wrote :

It doesn't need to look in tree. If it finds that PTRACE_SECCOMP_GET_METADATA is not defined, it defines it itself, then defines the struct. I can't see how the latest bionic linux-libc-dev would have broken this. And not even the test or kernel source code. I can't reproduce this locally. So, maybe some other package that is installed by other tests break this. This is still pending investigation.

Cascardo.

Revision history for this message
Kelsey Steele (kelsey-steele) wrote :

Failed on Bionic/oracle : 5.4.0-1026.26~18.04.1 : amd64

tags: added: amd64 oracle sru-20200921
Po-Hsu Lin (cypressyew)
tags: added: gcp
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Looks like this is caused by the libc6 / libc-dev-bin in the proposed pocket (version 2.27-3ubuntu1.3).

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Found on 5.4.0-1030.32~18.04.1 - oracle

tags: added: sru-20201109
Revision history for this message
Francis Ginther (fginther) wrote :

Seen on linux-oracle 5.4.0-1038.41~18.04.1.

tags: added: sru-20210125
tags: added: hwe sru-20210315
tags: added: sru-20210412
tags: added: hwe-5.4
Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

Observed in B-5.4/aws, cycle sru-20210531 .

tags: added: sru-20210531
Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :

Issue found with bionic/linux-hwe-5.4 5.4.0-79.88~18.04.1.

tags: added: sru-20210621
Sean Feole (sfeole)
tags: added: hinted
Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

Observed in B-5.4/aws, cycle sru-20210621 .

tags: added: aws
Revision history for this message
Krzysztof Kozlowski (krzk) wrote :

Found on 2021.09.27/bionic/linux-azure-5.4/5.4.0-1060.63~18.04.1

tags: added: sru-20210927
Changed in linux (Ubuntu):
status: New → Invalid
Changed in linux (Ubuntu Focal):
status: New → Confirmed
description: updated
Po-Hsu Lin (cypressyew)
Changed in linux (Ubuntu Focal):
status: Confirmed → In Progress
assignee: nobody → Luke Nowakowski-Krijger (lukenow)
Changed in linux (Ubuntu Focal):
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux/5.4.0-97.110 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

END GOOD ubuntu_kernel_selftests.seccomp-build

Verified with 5.4.0-97.110~18.04.1 on node fili.

tags: added: verification-done-focal
removed: verification-needed-focal
Changed in ubuntu-kernel-tests:
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (31.9 KiB)

This bug was fixed in the package linux - 5.4.0-97.110

---------------
linux (5.4.0-97.110) focal; urgency=medium

  * icmp_redirect from selftests fails on F/kvm (unary operator expected)
    (LP: #1938964)
    - selftests: icmp_redirect: pass xfail=0 to log_test()

  * Focal: CIFS stable updates (LP: #1954926)
    - cifs: use the expiry output of dns_query to schedule next resolution
    - cifs: set a minimum of 120s for next dns resolution
    - cifs: To match file servers, make sure the server hostname matches

  * seccomp_bpf in seccomp from ubuntu_kernel_selftests failed to build on B-5.4
    (LP: #1896420)
    - SAUCE: selftests/seccomp: fix "storage size of 'md' isn't known" build issue
    - SAUCE: selftests/seccomp: Fix s390x regs not defined issue

  * system crash when removing ipmi_msghandler module (LP: #1950666)
    - ipmi: Move remove_work to dedicated workqueue
    - ipmi: msghandler: Make symbol 'remove_work_wq' static

  * zcrypt DD: Toleration for new IBM Z Crypto Hardware - (Backport to Ubuntu
    20.04) (LP: #1954680)
    - s390/AP: support new dynamic AP bus size limit

  * [UBUNTU 20.04] KVM hardware diagnose data improvements for guest kernel -
    kernel part (LP: #1953334)
    - s390/setup: diag 318: refactor struct
    - s390/kvm: diagnose 0x318 sync and reset
    - KVM: s390: remove diag318 reset code
    - KVM: s390: add debug statement for diag 318 CPNC data

  * Updates to ib_peer_memory requested by Nvidia (LP: #1947206)
    - SAUCE: RDMA/core: Updated ib_peer_memory

  * Include Infiniband Peer Memory interface (LP: #1923104)
    - IB: Allow calls to ib_umem_get from kernel ULPs
    - SAUCE: RDMA/core: Introduce peer memory interface

  * Focal update: v5.4.162 upstream stable release (LP: #1954834)
    - arm64: zynqmp: Do not duplicate flash partition label property
    - arm64: zynqmp: Fix serial compatible string
    - ARM: dts: NSP: Fix mpcore, mmc node names
    - scsi: lpfc: Fix list_add() corruption in lpfc_drain_txq()
    - arm64: dts: hisilicon: fix arm,sp805 compatible string
    - RDMA/bnxt_re: Check if the vlan is valid before reporting
    - usb: musb: tusb6010: check return value after calling
      platform_get_resource()
    - usb: typec: tipd: Remove WARN_ON in tps6598x_block_read
    - arm64: dts: qcom: msm8998: Fix CPU/L2 idle state latency and residency
    - arm64: dts: freescale: fix arm,sp805 compatible string
    - ASoC: SOF: Intel: hda-dai: fix potential locking issue
    - clk: imx: imx6ul: Move csi_sel mux to correct base register
    - ASoC: nau8824: Add DMI quirk mechanism for active-high jack-detect
    - scsi: advansys: Fix kernel pointer leak
    - firmware_loader: fix pre-allocated buf built-in firmware use
    - ARM: dts: omap: fix gpmc,mux-add-data type
    - usb: host: ohci-tmio: check return value after calling
      platform_get_resource()
    - ARM: dts: ls1021a: move thermal-zones node out of soc/
    - ARM: dts: ls1021a-tsn: use generic "jedec,spi-nor" compatible for flash
    - ALSA: ISA: not for M68K
    - tty: tty_buffer: Fix the softlockup issue in flush_to_ldisc
    - MIPS: sni: Fix the build
    - scsi: target: Fix ordered tag handling
    - scsi: target: Fix al...

Changed in linux (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-ibm-5.4/5.4.0-1014.15~18.04.1 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed-bionic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-bionic
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.