selftests: memfd: run_hugetlbfs_test.sh - invalid opcode: 0000 [#1] PREEMPT SMP

From: Naresh Kamboju
Date: Thu Jan 05 2023 - 04:44:56 EST


While running selftests: memfd: run_hugetlbfs_test.sh on qemu_i386 and i386 the
following invalid opcode was noticed on stable-rc 6.1 and 6.0.

This is always reproducible on stable-rc 6.1 and 6.0 with qemu_i386 and i386.
Build, config and test log details provided in the below links [1].

Reported-by: Linux Kernel Functional Testing <lkft@xxxxxxxxxx>

# selftests: memfd: run_hugetlbfs_test.sh
[ 111.866742] run_hugetlbfs_t (1023): drop_caches: 3
[ 111.892484] invalid opcode: 0000 [#1] PREEMPT SMP
[ 111.893089] CPU: 2 PID: 1026 Comm: memfd_test Tainted: G
N 6.1.4-rc1 #1
[ 111.894015] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS 1.12.0-1 04/01/2014
[ 111.895048] EIP: hugetlb_file_setup.cold+0x0/0x33
[ 111.895597] Code: ff e9 07 f3 26 ff 0f 0b c7 04 24 c8 ee dd c9 e8
25 47 ff ff b8 ea ff ff ff e9 ac f8 26 ff 0f 0b 0f 0b 0f 0b 0f 0b 0f
0b 0f 0b <0f> 0b 64 a1 98 48 3a ca c6 05 f3 42 22 ca 01 8b 90 d4 03 00
00 05
[ 111.897716] EAX: c4957128 EBX: 00000000 ECX: 00000020 EDX: 00000000
[ 111.898431] ESI: 80000004 EDI: 00000005 EBP: c552bf04 ESP: c552bee4
[ 111.899218] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 EFLAGS: 00010212
[ 111.899991] CR0: 80050033 CR2: 00000000 CR3: 0528b000 CR4: 003506d0
[ 111.900774] Call Trace:
[ 111.901072] __ia32_sys_memfd_create+0x196/0x220
[ 111.901616] __do_fast_syscall_32+0x77/0xd0
[ 111.902119] do_fast_syscall_32+0x32/0x70
[ 111.902620] do_SYSENTER_32+0x15/0x20
[ 111.903134] entry_SYSENTER_32+0x98/0xf6
[ 111.903701] EIP: 0xb7ef1549
[ 111.904034] Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01
10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f
34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d 76 00 58 b8 77 00 00 00 cd 80 90
8d 76
[ 111.906124] EAX: ffffffda EBX: 0804b486 ECX: 80000004 EDX: 080493de
[ 111.906902] ESI: b7ccf220 EDI: b7dc58e0 EBP: bfe56cf8 ESP: bfe56c8c
[ 111.907637] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00000292
[ 111.908502] Modules linked in: sch_fq_codel fuse configfs [last
unloaded: test_strscpy(N)]
[ 111.909502] ---[ end trace 0000000000000000 ]---
[ 111.910064] EIP: hugetlb_file_setup.cold+0x0/0x33
[ 111.910638] Code: ff e9 07 f3 26 ff 0f 0b c7 04 24 c8 ee dd c9 e8
25 47 ff ff b8 ea ff ff ff e9 ac f8 26 ff 0f 0b 0f 0b 0f 0b 0f 0b 0f
0b 0f 0b <0f> 0b 64 a1 98 48 3a ca c6 05 f3 42 22 ca 01 8b 90 d4 03 00
00 05
[ 111.912785] EAX: c4957128 EBX: 00000000 ECX: 00000020 EDX: 00000000
[ 111.913518] ESI: 80000004 EDI: 00000005 EBP: c552bf04 ESP: c552bee4
[ 111.914259] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 EFLAGS: 00010212
[ 111.915104] CR0: 80050033 CR2: 00000000 CR3: 0528b000 CR4: 003506d0
# ./run_hugetlbfs_test.sh: line 60: 1026 Segmentation fault
./memfd_test hugetlbfs
# opening: ./mnt/memfd
# fuse: DONE
ok 3 selftests: memfd: run_hugetlbfs_test.sh

[1]
https://lkft.validation.linaro.org/scheduler/job/6022150#L2079
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.3-208-ga31425cbf493/testrun/13974189/suite/log-parser-test/tests/
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.3-208-ga31425cbf493/testrun/13974189/suite/log-parser-test/test/check-kernel-invalid-opcode/details/

metadata:
git_ref: linux-6.1.y
git_repo: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
git_sha: a31425cbf493ef8bc7f7ce775a1028b1e0612f32
git_describe: v6.1.3-208-ga31425cbf493
kernel_version: 6.1.4-rc1
kernel-config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2JrzvZc223pctlAxVhCIebJ8q0w/config
build-url: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc/-/pipelines/738268273
artifact-location:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2JrzvZc223pctlAxVhCIebJ8q0w
toolchain: gcc-11
vmlinux: https://storage.tuxsuite.com/public/linaro/lkft/builds/2JrzvZc223pctlAxVhCIebJ8q0w/vmlinux.xz
System.map: https://storage.tuxsuite.com/public/linaro/lkft/builds/2JrzvZc223pctlAxVhCIebJ8q0w/System.map

--
Linaro LKFT
https://lkft.linaro.org