memfd from ubuntu_kernel_selftests failed to build on B-5.4 (error: ‘F_SEAL_FUTURE_WRITE’ undeclared)

Bug #1926142 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
Undecided
Unassigned
linux (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Unassigned
Focal
Undecided
Unassigned
linux-hwe (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Unassigned
Focal
Undecided
Unassigned
linux-hwe-5.4 (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Unassigned
Focal
Undecided
Unassigned

Bug Description

Test build on B-5.4 (5.4.0-73.82~18.04.1) failed with:
  error: ‘F_SEAL_FUTURE_WRITE’ undeclared

Build log:
$ sudo make TARGETS=memfd
make --no-builtin-rules ARCH=x86 -C ../../.. headers_install
make[1]: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux'
  INSTALL ./usr/include
make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux'
make[1]: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd'
gcc -D_FILE_OFFSET_BITS=64 -I../../../../include/uapi/ -I../../../../include/ -I../../../../usr/include/ memfd_test.c common.o -o /home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd/memfd_test
memfd_test.c: In function ‘test_seal_future_write’:
memfd_test.c:749:27: error: ‘F_SEAL_FUTURE_WRITE’ undeclared (first use in this function); did you mean ‘F_SEAL_WRITE’?
  mfd_assert_add_seals(fd, F_SEAL_FUTURE_WRITE);
                           ^~~~~~~~~~~~~~~~~~~
                           F_SEAL_WRITE
memfd_test.c:749:27: note: each undeclared identifier is reported only once for each function it appears in
../lib.mk:141: recipe for target '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd/memfd_test' failed
make[1]: *** [/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd/memfd_test] Error 1
make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd'
Makefile:143: recipe for target 'all' failed
make: *** [all] Error 2

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

It looks like this was caused by my fix for bug 1910323.

Maybe we can revert the one for B-5.4 and keep the one for F/G.

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

As this is just affecting the testing tool, I think we don't need to add the kqa-blocker tag to it.

Revision history for this message
Kelsey Skunberg (kelsey-skunberg) wrote :

Found this on B/hwe-5.4 through ADT as well

tags: added: hwe hwe-5.4
Revision history for this message
Ian May (ian-may) wrote :

bionic/linux-gke-5.4: 5.4.0-1043.45~18.04.1

Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

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

tags: added: aws sru-20210531
tags: added: sru-20210621
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

A quick check shows this test was introduced in 544029862c selftests/memfd: add tests for F_SEAL_FUTURE_WRITE seal [1]

As this issue does not exist in F-5.4, I think it might have something to do with B-hwe-5.4.

Run `git grep F_SEAL_FUTURE_WRITE` in B-hwe-5.4 and Focal tree shows the following is missing on the former:

include/linux/mm.h: * seal_check_future_write - Check for F_SEAL_FUTURE_WRITE flag and handle it
include/linux/mm.h: * Check whether F_SEAL_FUTURE_WRITE is set; if so, do proper check/handling on
include/linux/mm.h: if (seals & F_SEAL_FUTURE_WRITE) {
include/linux/mm.h: * Since an F_SEAL_FUTURE_WRITE sealed memfd can be mapped as

Diff: https://pastebin.ubuntu.com/p/8k5djst6C3/

[1] https://github.com/torvalds/linux/commit/544029862cbb1d7903e19f2e58f48d4884e1201b

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 .

Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

Observed this on B/oracle-5.4, cycle sru-20210621 .

tags: added: oracle
Changed in linux-hwe (Ubuntu):
status: New → Invalid
Changed in linux-hwe (Ubuntu Bionic):
status: New → Invalid
Changed in linux-hwe-5.4 (Ubuntu):
status: New → Invalid
Changed in linux-hwe-5.4 (Ubuntu Bionic):
status: New → Invalid
Changed in linux-hwe-5.4 (Ubuntu Focal):
status: New → Invalid
Changed in linux-hwe (Ubuntu Focal):
status: New → Invalid
Changed in linux (Ubuntu Bionic):
status: New → Invalid
Changed in linux (Ubuntu):
status: New → Invalid
Changed in linux (Ubuntu Focal):
status: New → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the 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 :
Po-Hsu Lin (cypressyew)
summary: - memfd from ubuntu_kernel_selftests failed to build on B-5.4
+ memfd from ubuntu_kernel_selftests failed to build on B-5.4 (error:
+ ‘F_SEAL_FUTURE_WRITE’ undeclared)
Revision history for this message
Luke Nowakowski-Krijger (lukenow) wrote :

Another build issue affecting B/5.4 kernels with __u64 for reference https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/1944613

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (34.1 KiB)

This bug was fixed in the package linux-hwe-5.4 - 5.4.0-87.98~18.04.1

---------------
linux-hwe-5.4 (5.4.0-87.98~18.04.1) bionic; urgency=medium

  * bionic/linux-hwe-5.4: 5.4.0-87.98~18.04.1 -proposed tracker (LP: #1944527)

  * please drop virtualbox-guest-dkms virtualbox-guest-source (LP: #1933248)
    - [Packaging] hwe: disable building virtualbox from dkms

  [ Ubuntu: 5.4.0-87.98 ]

  * please drop virtualbox-guest-dkms virtualbox-guest-source (LP: #1933248)
    - [Config] Disable virtualbox dkms build
  * Packaging resync (LP: #1786013)
    - debian/dkms-versions -- update from kernel-versions (main/2021.09.06)
  * LRMv5: switch primary version handling to kernel-versions data set
    (LP: #1928921)
    - [Packaging] switch to kernel-versions
  * disable “CONFIG_HISI_DMA” config for ubuntu version (LP: #1936771)
    - Disable CONFIG_HISI_DMA
    - [Config] Record hisi_dma no longer built for arm64
  * memory leaking when removing a profile (LP: #1939915)
    - apparmor: Fix memory leak of profile proxy
  * CryptoExpress EP11 cards are going offline (LP: #1939618)
    - s390/zcrypt: Support for CCA protected key block version 2
    - s390: Replace zero-length array with flexible-array member
    - s390/zcrypt: Use scnprintf() for avoiding potential buffer overflow
    - s390/zcrypt: replace snprintf/sprintf with scnprintf
    - s390/ap: Remove ap device suspend and resume callbacks
    - s390/zcrypt: use fallthrough;
    - s390/zcrypt: use kvmalloc instead of kmalloc for 256k alloc
    - s390/ap: remove power management code from ap bus and drivers
    - s390/ap: introduce new ap function ap_get_qdev()
    - s390/zcrypt: use kzalloc
    - s390/zcrypt: fix smatch warnings
    - s390/zcrypt: code beautification and struct field renames
    - s390/zcrypt: split ioctl function into smaller code units
    - s390/ap: rename and clarify ap state machine related stuff
    - s390/zcrypt: provide cex4 cca sysfs attributes for cex3
    - s390/ap: rework crypto config info and default domain code
    - s390/zcrypt: simplify cca_findcard2 loop code
    - s390/zcrypt: remove set_fs() invocation in zcrypt device driver
    - s390/ap: remove unnecessary spin_lock_init()
    - s390/zcrypt: Support for CCA APKA master keys
    - s390/zcrypt: introduce msg tracking in zcrypt functions
    - s390/ap: split ap queue state machine state from device state
    - s390/ap: add error response code field for ap queue devices
    - s390/ap: add card/queue deconfig state
    - s390/sclp: Add support for SCLP AP adapter config/deconfig
    - s390/ap: Support AP card SCLP config and deconfig operations
    - s390/ap/zcrypt: revisit ap and zcrypt error handling
    - s390/zcrypt: move ap_msg param one level up the call chain
    - s390/zcrypt: Introduce Failure Injection feature
    - s390/zcrypt: fix wrong format specifications
    - s390/ap: fix ap devices reference counting
    - s390/zcrypt: return EIO when msg retry limit reached
    - s390/zcrypt: fix zcard and zqueue hot-unplug memleak
    - s390/ap: Fix hanging ioctl caused by wrong msg counter
  * memfd from ubuntu_kernel_selftests failed to build on B-5.4 (LP: #1926142)
    - SAUCE: selftests/memfd: fix bui...

Changed in linux-hwe-5.4 (Ubuntu Bionic):
status: Invalid → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (34.1 KiB)

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

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

  * focal/linux: 5.4.0-88.99 -proposed tracker (LP: #1944747)

  * Packaging resync (LP: #1786013)
    - debian/dkms-versions -- update from kernel-versions (main/2021.09.06)

  * please drop virtualbox-guest-dkms virtualbox-guest-source (LP: #1933248)
    - Revert "UBUNTU: [Config] Disable virtualbox dkms build"

linux (5.4.0-87.98) focal; urgency=medium

  * please drop virtualbox-guest-dkms virtualbox-guest-source (LP: #1933248)
    - [Config] Disable virtualbox dkms build

  * Packaging resync (LP: #1786013)
    - debian/dkms-versions -- update from kernel-versions (main/2021.09.06)

  * LRMv5: switch primary version handling to kernel-versions data set
    (LP: #1928921)
    - [Packaging] switch to kernel-versions

  * disable “CONFIG_HISI_DMA” config for ubuntu version (LP: #1936771)
    - Disable CONFIG_HISI_DMA
    - [Config] Record hisi_dma no longer built for arm64

  * memory leaking when removing a profile (LP: #1939915)
    - apparmor: Fix memory leak of profile proxy

  * CryptoExpress EP11 cards are going offline (LP: #1939618)
    - s390/zcrypt: Support for CCA protected key block version 2
    - s390: Replace zero-length array with flexible-array member
    - s390/zcrypt: Use scnprintf() for avoiding potential buffer overflow
    - s390/zcrypt: replace snprintf/sprintf with scnprintf
    - s390/ap: Remove ap device suspend and resume callbacks
    - s390/zcrypt: use fallthrough;
    - s390/zcrypt: use kvmalloc instead of kmalloc for 256k alloc
    - s390/ap: remove power management code from ap bus and drivers
    - s390/ap: introduce new ap function ap_get_qdev()
    - s390/zcrypt: use kzalloc
    - s390/zcrypt: fix smatch warnings
    - s390/zcrypt: code beautification and struct field renames
    - s390/zcrypt: split ioctl function into smaller code units
    - s390/ap: rename and clarify ap state machine related stuff
    - s390/zcrypt: provide cex4 cca sysfs attributes for cex3
    - s390/ap: rework crypto config info and default domain code
    - s390/zcrypt: simplify cca_findcard2 loop code
    - s390/zcrypt: remove set_fs() invocation in zcrypt device driver
    - s390/ap: remove unnecessary spin_lock_init()
    - s390/zcrypt: Support for CCA APKA master keys
    - s390/zcrypt: introduce msg tracking in zcrypt functions
    - s390/ap: split ap queue state machine state from device state
    - s390/ap: add error response code field for ap queue devices
    - s390/ap: add card/queue deconfig state
    - s390/sclp: Add support for SCLP AP adapter config/deconfig
    - s390/ap: Support AP card SCLP config and deconfig operations
    - s390/ap/zcrypt: revisit ap and zcrypt error handling
    - s390/zcrypt: move ap_msg param one level up the call chain
    - s390/zcrypt: Introduce Failure Injection feature
    - s390/zcrypt: fix wrong format specifications
    - s390/ap: fix ap devices reference counting
    - s390/zcrypt: return EIO when msg retry limit reached
    - s390/zcrypt: fix zcard and zqueue hot-unplug memleak
    - s390/ap: Fix hanging ioctl caused by wrong msg counter

  * memfd from ubuntu_kernel_s...

Changed in linux (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

This issue does not exist anymore. Confirmed on:
  * B-aws-5.4
  * B-azure-5.4
  * B-hwe-5.4
  * B-oracle-5.4

Changed in ubuntu-kernel-tests:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers