Fix implicit declaration warnings for kselftests/memfd test on newer releases

Bug #1910323 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Po-Hsu Lin
Groovy
Fix Released
Undecided
Po-Hsu Lin
Hirsute
Fix Released
Undecided
Unassigned
linux-oem-5.6 (Ubuntu)
Invalid
Undecided
Unassigned
Focal
Fix Released
Undecided
Po-Hsu Lin

Bug Description

[Impact]
While debugging bug 1910277, I found that the test compilation will
print some warnings:
  memfd_test.c:64:7: warning: implicit declaration of function ‘open’;
  memfd_test.c:90:6: warning: implicit declaration of function ‘fcntl’
  memfd_test.c:397:6: warning: implicit declaration of function ‘fallocate’;
  fuse_test.c:67:6: warning: implicit declaration of function ‘fcntl’
  fuse_test.c:261:7: warning: implicit declaration of function ‘open’;

It's harmless but fixing this we can make the test report easier to
read.

[Fix]
* 1c49e3783f8899 ("selftests/memfd: Fix implicit declaration warnings")

This fix can be cherry-picked into F/F-oem-5.6/G and compiled without
any problem. Older kernel does not have this issue since they're
missing some other commits.

[Test Case]
Build the memfd test in tools/testing/selftests/ with:
  sudo make TARGETS=memfd

With this fix, these warnings will be gone.

[Where problems could occur]
This fix is just for fixing the test case compilation, so it's not
affecting real kernel functionality.

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1910323

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Po-Hsu Lin (cypressyew)
summary: - Fix implicit declaration warnings for kselftests/memfd
+ Fix implicit declaration warnings for kselftests/memfd test on newer
+ releases
Po-Hsu Lin (cypressyew)
description: updated
description: updated
Po-Hsu Lin (cypressyew)
description: updated
Po-Hsu Lin (cypressyew)
Changed in linux (Ubuntu Hirsute):
status: Incomplete → Fix Released
description: updated
Po-Hsu Lin (cypressyew)
description: updated
description: updated
Po-Hsu Lin (cypressyew)
description: updated
Po-Hsu Lin (cypressyew)
no longer affects: linux-oem (Ubuntu)
no longer affects: linux-oem (Ubuntu Focal)
no longer affects: linux-oem (Ubuntu Groovy)
no longer affects: linux-oem (Ubuntu Hirsute)
Po-Hsu Lin (cypressyew)
no longer affects: linux-oem-5.6 (Ubuntu Groovy)
no longer affects: linux-oem-5.6 (Ubuntu Hirsute)
no longer affects: linux-oem-5.10 (Ubuntu)
Changed in linux (Ubuntu Focal):
status: New → In Progress
Changed in linux (Ubuntu Groovy):
status: New → In Progress
assignee: nobody → Po-Hsu Lin (cypressyew)
Changed in linux (Ubuntu Focal):
assignee: nobody → Po-Hsu Lin (cypressyew)
Changed in linux-oem-5.6 (Ubuntu Focal):
assignee: nobody → Po-Hsu Lin (cypressyew)
status: New → In Progress
Changed in linux-oem-5.10 (Ubuntu):
status: New → In Progress
assignee: nobody → Po-Hsu Lin (cypressyew)
Po-Hsu Lin (cypressyew)
description: updated
no longer affects: linux-oem-5.10 (Ubuntu)
description: updated
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Changed in linux (Ubuntu Groovy):
status: In Progress → Fix Committed
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 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
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-groovy' to 'verification-done-groovy'. If the problem still exists, change the tag 'verification-needed-groovy' to 'verification-failed-groovy'.

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-groovy
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Build log clean in Groovy 5.8.0-51.57
 Running 'sudo sh -c 'echo 1 > /proc/sys/net/ipv4/conf/all/accept_local''
 Running 'sudo make -C linux/tools/testing/selftests TARGETS=memfd run_tests'
 make: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests'
 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.c -o /home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd/memfd_test
 gcc -D_FILE_OFFSET_BITS=64 -I../../../../include/uapi/ -I../../../../include/ -I../../../../usr/include/ fuse_test.c common.c -o /home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd/fuse_test
 gcc -D_FILE_OFFSET_BITS=64 -I../../../../include/uapi/ -I../../../../include/ -I../../../../usr/include/ fuse_mnt.c -lfuse -pthread -o /home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd/fuse_mnt
 make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd'
 make[1]: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd'
 TAP version 13
 1..3
 # selftests: memfd: memfd_test
 # memfd: CREATE
 # memfd: BASIC
 # memfd: SEAL-WRITE
 # memfd: SEAL-FUTURE-WRITE
 # memfd: CREATE
 # memfd: BASIC
 # memfd: SEAL-WRITE
 # memfd: SEAL-FUTURE-WRITE
 # memfd: SEAL-SHRINK
 # memfd: SEAL-GROW
 # memfd: SEAL-RESIZE
 # memfd: SHARE-DUP
 # memfd: SHARE-MMAP
 # memfd: SHARE-OPEN
 # memfd: SHARE-FORK
 # memfd: SHARE-DUP (shared file-table)
 # memfd: SHARE-MMAP (shared file-table)
 # memfd: SHARE-OPEN (shared file-table)
 # memfd: SHARE-FORK (shared file-table)
 # memfd: DONE
 ok 1 selftests: memfd: memfd_test
 # selftests: memfd: run_fuse_test.sh
 # opening: ./mnt/memfd
 # fuse: DONE
 ok 2 selftests: memfd: run_fuse_test.sh
 # selftests: memfd: run_hugetlbfs_test.sh
 # ./run_hugetlbfs_test.sh: line 60: 31300 Aborted (core dumped) ./memfd_test hugetlbfs
 # opening: ./mnt/memfd
 # fuse: DONE
 ok 3 selftests: memfd: run_hugetlbfs_test.sh
 make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd'
 make: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests'
 ========== Summary ===========
 No failed cases reported

tags: added: verification-done-groovy
removed: verification-needed-groovy
tags: added: 5.4 5.8
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Build log clean on Focal 5.4.0-73.82

 Running 'sudo sh -c 'echo 1 > /proc/sys/net/ipv4/conf/all/accept_local''
 Running 'sudo make -C linux/tools/testing/selftests TARGETS=memfd run_tests'
 make: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests'
 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/ -c -o common.o common.c
 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
 gcc -D_FILE_OFFSET_BITS=64 -I../../../../include/uapi/ -I../../../../include/ -I../../../../usr/include/ fuse_mnt.c -lfuse -pthread -o /home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd/fuse_mnt
 gcc -D_FILE_OFFSET_BITS=64 -I../../../../include/uapi/ -I../../../../include/ -I../../../../usr/include/ fuse_test.c common.o -o /home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd/fuse_test
 make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd'
 make[1]: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd'
 TAP version 13
 1..3
 # selftests: memfd: memfd_test
 # memfd: CREATE
 # memfd: BASIC
 # memfd: SEAL-WRITE
 # memfd: SEAL-FUTURE-WRITE
 # memfd: SEAL-SHRINK
 # memfd: SEAL-GROW
 # memfd: SEAL-RESIZE
 # memfd: SHARE-DUP
 # memfd: SHARE-MMAP
 # memfd: SHARE-OPEN
 # memfd: SHARE-FORK
 # memfd: SHARE-DUP (shared file-table)
 # memfd: SHARE-MMAP (shared file-table)
 # memfd: SHARE-OPEN (shared file-table)
 # memfd: SHARE-FORK (shared file-table)
 # memfd: DONE
 ok 1 selftests: memfd: memfd_test
 # selftests: memfd: run_fuse_test.sh
 # opening: ./mnt/memfd
 # fuse: DONE
 ok 2 selftests: memfd: run_fuse_test.sh
 # selftests: memfd: run_hugetlbfs_test.sh
 # ./run_hugetlbfs_test.sh: line 60: 25940 Aborted (core dumped) ./memfd_test hugetlbfs
 # opening: ./mnt/memfd
 # fuse: DONE
 ok 3 selftests: memfd: run_hugetlbfs_test.sh
 make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd'
 make: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests'
 ========== Summary ===========
 No failed cases reported

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

Note that F-5.8 is ok, however B-5.4 is not, please see bug 1926142

AceLan Kao (acelankao)
Changed in linux-oem-5.6 (Ubuntu Focal):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (40.7 KiB)

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

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

  * focal/linux: 5.4.0-73.82 -proposed tracker (LP: #1923781)

  * Packaging resync (LP: #1786013)
    - update dkms package versions

  * CIFS DFS entries not accessible with 5.4.0-71.74-generic (LP: #1923670)
    - Revert "cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting
      cifs_sb->prepath."

  * CVE-2021-29650
    - Revert "netfilter: x_tables: Update remaining dereference to RCU"
    - Revert "netfilter: x_tables: Switch synchronization to RCU"
    - netfilter: x_tables: Use correct memory barriers.

  * LRMv4: switch to signing nvidia modules via the Ubuntu Modules signing key
    (LP: #1918134)
    - [Packaging] dkms-build{,--nvidia-N} sync back from LRMv4

  * 5.4 kernel: when iommu is on crashdump fails (LP: #1922738)
    - iommu/vt-d: Refactor find_domain() helper
    - iommu/vt-d: Add attach_deferred() helper
    - iommu/vt-d: Move deferred device attachment into helper function
    - iommu/vt-d: Do deferred attachment in iommu_need_mapping()
    - iommu/vt-d: Remove deferred_attach_domain()
    - iommu/vt-d: Simplify check in identity_mapping()

  * Backport mlx5e fix for tunnel offload (LP: #1921769)
    - net/mlx5e: Check tunnel offload is required before setting SWP

  * Bcache bypasse writeback on caching device with fragmentation (LP: #1900438)
    - bcache: consider the fragmentation when update the writeback rate

  * Fix implicit declaration warnings for kselftests/memfd test on newer
    releases (LP: #1910323)
    - selftests/memfd: Fix implicit declaration warnings

  * net/mlx5e: Add missing capability check for uplink follow (LP: #1921104)
    - net/mlx5e: Add missing capability check for uplink follow

  * [UBUNUT 21.04] s390/vtime: fix increased steal time accounting
    (LP: #1921498)
    - s390/vtime: fix increased steal time accounting

  * Mute/Mic-mute LEDs are not work on HP 850/840/440 G8 Laptops (LP: #1920030)
    - ALSA: hda/realtek: fix mute/micmute LEDs for HP 840 G8
    - ALSA: hda/realtek: fix mute/micmute LEDs for HP 440 G8
    - ALSA: hda/realtek: fix mute/micmute LEDs for HP 850 G8

  * Focal update: v5.4.106 upstream stable release (LP: #1920246)
    - uapi: nfnetlink_cthelper.h: fix userspace compilation error
    - powerpc/pseries: Don't enforce MSI affinity with kdump
    - ath9k: fix transmitting to stations in dynamic SMPS mode
    - net: Fix gro aggregation for udp encaps with zero csum
    - net: check if protocol extracted by virtio_net_hdr_set_proto is correct
    - net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0
    - sh_eth: fix TRSCER mask for SH771x
    - can: skb: can_skb_set_owner(): fix ref counting if socket was closed before
      setting skb ownership
    - can: flexcan: assert FRZ bit in flexcan_chip_freeze()
    - can: flexcan: enable RX FIFO after FRZ/HALT valid
    - can: flexcan: invoke flexcan_chip_freeze() to enter freeze mode
    - can: tcan4x5x: tcan4x5x_init(): fix initialization - clear MRAM before
      entering Normal Mode
    - tcp: add sanity tests to TCP_QUEUE_SEQ
    - netfilter: nf_nat: undo erroneous tcp edemux lookup
    - ne...

Changed in linux (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-oem-5.6 - 5.6.0-1056.60

---------------
linux-oem-5.6 (5.6.0-1056.60) focal; urgency=medium

  * focal/linux-oem-5.6: 5.6.0-1056.60 -proposed tracker (LP: #1923783)

  * CVE-2021-29646
    - tipc: better validate user input in tipc_nl_retrieve_key()

  * CVE-2021-28375
    - misc: fastrpc: restrict user apps from sending kernel RPC messages

  * CVE-2020-35519
    - net/x25: prevent a couple of overflows

  * CVE-2021-30002
    - media: v4l: ioctl: Fix memory leak in video_usercopy

  * SND_PCI_QUIRK for Clevo NH55RZQ and Intel NUC10 (LP: #1922759)
    - ALSA: hda/realtek: Add quirk for Intel NUC 10
    - ALSA: hda/realtek: Add quirk for Clevo NH55RZQ

  * CVE-2021-29650
    - netfilter: x_tables: Use correct memory barriers.

  * Fix implicit declaration warnings for kselftests/memfd test on newer
    releases (LP: #1910323)
    - selftests/memfd: Fix implicit declaration warnings

 -- Chia-Lin Kao (AceLan) <email address hidden> Tue, 04 May 2021 11:46:25 +0800

Changed in linux-oem-5.6 (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 5.8.0-53.60

---------------
linux (5.8.0-53.60) groovy; urgency=medium

  * CVE-2021-3491
    - io_uring: fix provide_buffers sign extension
    - io_uring: fix overflows checks in provide buffers
    - SAUCE: proc: Avoid mixing integer types in mem_rw()
    - SAUCE: io_uring: truncate lengths larger than MAX_RW_COUNT on provide
      buffers

  * CVE-2021-3490
    - bpf: Fix a verifier failure with xor
    - SAUCE: bpf: verifier: fix ALU32 bounds tracking with bitwise ops

  * CVE-2021-3489
    - SAUCE: bpf: ringbuf: deny reserve of buffers larger than ringbuf
    - SAUCE: bpf: prevent writable memory-mapping of read-only ringbuf pages

 -- Stefan Bader <email address hidden> Thu, 06 May 2021 07:43:20 +0200

Changed in linux (Ubuntu Groovy):
status: Fix Committed → Fix Released
Po-Hsu Lin (cypressyew)
Changed in linux-oem-5.6 (Ubuntu):
status: New → Invalid
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.