memfd_test from ubuntu_kernel_selftests failed with J-oem-6.5

Bug #2036959 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
New
Undecided
Unassigned

Bug Description

Issue found with J-oem-6.5.0-1004.4

This issue does not exist with -1003, but after comparing the test output. It looks like there is a new test case "memfd: sysctl" added in -1004.

Test failed with:
$ sudo ./memfd_test
memfd: CREATE
memfd: BASIC
memfd: SEAL-EXEC
memfd: Apply SEAL_EXEC
memfd: Apply ALL_SEALS
memfd: EXEC_NO_SEAL
memfd: NOEXEC_SEAL
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: sysctl 0
memfd: sysctl 1
memfd: child ns
write sysctl 0 succeeded, but failure expected
newpid thread: killed by signal 11
Aborted

In dmesg you will see:
[13767.435614] traps: memfd_test[355397] general protection fault ip:7f5aef428898 sp:560eb3872570 error:0 in libc.so.6[7f5aef428000+195000]

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

Test output with -1003:
 Running 'make run_tests -C memfd TEST_PROGS=memfd_test TEST_GEN_PROGS='' TEST_CUSTOM_PROGS='''
 make: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/memfd'
 TAP version 13
 1..1
 # timeout set to 45
 # selftests: memfd: memfd_test
 # memfd: CREATE
 # memfd: BASIC
 # memfd: SEAL-EXEC
 # memfd: Apply SEAL_EXEC
 # memfd: Apply ALL_SEALS
 # memfd: EXEC_NO_SEAL
 # memfd: NOEXEC_SEAL
 # memfd: SEAL-WRITE
 # memfd: SEAL-FUTURE-WRITE
 # memfd: CREATE
 # memfd: BASIC
 # memfd: SEAL-EXEC
 # memfd: Apply SEAL_EXEC
 # memfd: Apply ALL_SEALS
 # memfd: EXEC_NO_SEAL
 # memfd: NOEXEC_SEAL
 # 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

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

I tried to test J-oem-6.5.0-1003 with -1003 source tree on a VM, however the test output looks like -1004 and it's failing as well.

$ sudo ./memfd_test
memfd: CREATE
memfd: BASIC
memfd: SEAL-EXEC
memfd: Apply SEAL_EXEC
memfd: Apply ALL_SEALS
memfd: EXEC_NO_SEAL
memfd: NOEXEC_SEAL
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: sysctl 0
memfd: sysctl 1
memfd: child ns
memfd: sysctl 2
memfd_create("kern_memfd_sysctl_2_exec", 19) succeeded, but failure expected
newpid thread: killed by signal 11
Aborted

I am not sure how did we get the pass result back in -1003 in d2023.08.23

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.