[17:49:27][root@250.1976_762998096.el9.x86_64+debug]# './test_progs -t test_ima' test_test_ima:PASS:skel_load 0 nsec test_test_ima:PASS:ringbuf 0 nsec test_test_ima:PASS:attach 0 nsec test_test_ima:PASS:mkdtemp 0 nsec test_test_ima:PASS:failed to run command 0 nsec test_test_ima:PASS:run_measured_process #1 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 2 != expected 1 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:run_measured_process #2 0 nsec test_test_ima:PASS:num_samples_or_err 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:modify-bin #3 0 nsec test_test_ima:PASS:run_measured_process #3 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual -28 != expected 2 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:FAIL:sample_equal_or_err unexpected sample_equal_or_err: actual -5991112663362547186 != expected 5709380419881618400 test_test_ima:PASS:sample_different_or_err 0 nsec test_test_ima:PASS:run_measured_process #4 0 nsec test_test_ima:PASS:num_samples_or_err 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:sample_different_or_err 0 nsec test_test_ima:PASS:sample_equal_or_err 0 nsec test_test_ima:PASS:restore-bin #3 0 nsec test_test_ima:PASS:run_measured_process #5 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 3 != expected 2 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:run_measured_process #6 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 1 != expected 0 test_test_ima:PASS:failed to run command 0 nsec #190 test_ima:FAIL All error logs: test_test_ima:PASS:skel_load 0 nsec test_test_ima:PASS:ringbuf 0 nsec test_test_ima:PASS:attach 0 nsec test_test_ima:PASS:mkdtemp 0 nsec test_test_ima:PASS:failed to run command 0 nsec test_test_ima:PASS:run_measured_process #1 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 2 != expected 1 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:run_measured_process #2 0 nsec test_test_ima:PASS:num_samples_or_err 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:modify-bin #3 0 nsec test_test_ima:PASS:run_measured_process #3 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual -28 != expected 2 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:FAIL:sample_equal_or_err unexpected sample_equal_or_err: actual -5991112663362547186 != expected 5709380419881618400 test_test_ima:PASS:sample_different_or_err 0 nsec test_test_ima:PASS:run_measured_process #4 0 nsec test_test_ima:PASS:num_samples_or_err 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:sample_different_or_err 0 nsec test_test_ima:PASS:sample_equal_or_err 0 nsec test_test_ima:PASS:restore-bin #3 0 nsec test_test_ima:PASS:run_measured_process #5 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 3 != expected 2 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:run_measured_process #6 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 1 != expected 0 test_test_ima:PASS:failed to run command 0 nsec #190 test_ima:FAIL Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED :: [ FAIL ] :: Command './test_progs -t test_ima' (Expected 0, got 1, score 2) [17:49:28][root@250.1976_762998096.el9.x86_64+debug]# './test_progs -vv -t test_ima' bpf_testmod.ko is already unloaded. Loading bpf_testmod.ko... Successfully loaded bpf_testmod.ko. libbpf: loading object 'ima' from buffer libbpf: elf: section(2) .symtab, size 624, link 1, flags 0, type=2 libbpf: elf: section(3) lsm.s/bprm_committed_creds, size 344, link 0, flags 6, type=1 libbpf: sec 'lsm.s/bprm_committed_creds': found program 'bprm_committed_creds' at insn offset 0 (0 bytes), code size 43 insns (344 bytes) libbpf: elf: section(4) lsm.s/bprm_creds_for_exec, size 384, link 0, flags 6, type=1 libbpf: sec 'lsm.s/bprm_creds_for_exec': found program 'bprm_creds_for_exec' at insn offset 0 (0 bytes), code size 48 insns (384 bytes) libbpf: elf: section(5) lsm.s/kernel_read_file, size 488, link 0, flags 6, type=1 libbpf: sec 'lsm.s/kernel_read_file': found program 'kernel_read_file' at insn offset 0 (0 bytes), code size 61 insns (488 bytes) libbpf: elf: section(6) .bss, size 8, link 0, flags 3, type=8 libbpf: elf: section(7) license, size 4, link 0, flags 3, type=1 libbpf: license of ima is GPL libbpf: elf: section(8) .maps, size 16, link 0, flags 3, type=1 libbpf: elf: section(9) .rellsm.s/bprm_committed_creds, size 48, link 2, flags 40, type=9 libbpf: elf: section(10) .rellsm.s/bprm_creds_for_exec, size 64, link 2, flags 40, type=9 libbpf: elf: section(11) .rellsm.s/kernel_read_file, size 80, link 2, flags 40, type=9 libbpf: elf: section(12) .BTF, size 6519, link 0, flags 0, type=1 libbpf: elf: section(13) .BTF.ext, size 1372, link 0, flags 0, type=1 libbpf: looking for externs among 26 symbols... libbpf: collected 0 externs total libbpf: map 'ringbuf': at sec_idx 8, offset 0. libbpf: map 'ringbuf': found type = 27. libbpf: map 'ringbuf': found max_entries = 4096. libbpf: map 'ima.bss' (global data): at sec_idx 6, offset 0, flags 400. libbpf: map 1 is "ima.bss" libbpf: sec '.rellsm.s/bprm_committed_creds': collecting relocation for section(3) 'lsm.s/bprm_committed_creds' libbpf: sec '.rellsm.s/bprm_committed_creds': relo #0: insn #5 against 'monitored_pid' libbpf: prog 'bprm_committed_creds': found data map 1 (ima.bss, sec 6, off 0) for insn 5 libbpf: sec '.rellsm.s/bprm_committed_creds': relo #1: insn #10 against 'use_ima_file_hash' libbpf: prog 'bprm_committed_creds': found data map 1 (ima.bss, sec 6, off 0) for insn 10 libbpf: sec '.rellsm.s/bprm_committed_creds': relo #2: insn #31 against 'ringbuf' libbpf: prog 'bprm_committed_creds': found map 0 (ringbuf, sec 8, off 0) for insn #31 libbpf: sec '.rellsm.s/bprm_creds_for_exec': collecting relocation for section(4) 'lsm.s/bprm_creds_for_exec' libbpf: sec '.rellsm.s/bprm_creds_for_exec': relo #0: insn #0 against 'enable_bprm_creds_for_exec' libbpf: prog 'bprm_creds_for_exec': found data map 1 (ima.bss, sec 6, off 0) for insn 0 libbpf: sec '.rellsm.s/bprm_creds_for_exec': relo #1: insn #9 against 'monitored_pid' libbpf: prog 'bprm_creds_for_exec': found data map 1 (ima.bss, sec 6, off 0) for insn 9 libbpf: sec '.rellsm.s/bprm_creds_for_exec': relo #2: insn #14 against 'use_ima_file_hash' libbpf: prog 'bprm_creds_for_exec': found data map 1 (ima.bss, sec 6, off 0) for insn 14 libbpf: sec '.rellsm.s/bprm_creds_for_exec': relo #3: insn #35 against 'ringbuf' libbpf: prog 'bprm_creds_for_exec': found map 0 (ringbuf, sec 8, off 0) for insn #35 libbpf: sec '.rellsm.s/kernel_read_file': collecting relocation for section(5) 'lsm.s/kernel_read_file' libbpf: sec '.rellsm.s/kernel_read_file': relo #0: insn #5 against 'enable_kernel_read_file' libbpf: prog 'kernel_read_file': found data map 1 (ima.bss, sec 6, off 0) for insn 5 libbpf: sec '.rellsm.s/kernel_read_file': relo #1: insn #11 against 'monitored_pid' libbpf: prog 'kernel_read_file': found data map 1 (ima.bss, sec 6, off 0) for insn 11 libbpf: sec '.rellsm.s/kernel_read_file': relo #2: insn #17 against 'test_deny' libbpf: prog 'kernel_read_file': found data map 1 (ima.bss, sec 6, off 0) for insn 17 libbpf: sec '.rellsm.s/kernel_read_file': relo #3: insn #27 against 'use_ima_file_hash' libbpf: prog 'kernel_read_file': found data map 1 (ima.bss, sec 6, off 0) for insn 27 libbpf: sec '.rellsm.s/kernel_read_file': relDiscarding device blocks: 0/10240 done Creating filesystem with 10240 1k blocks and 2560 inodes Filesystem UUID: 3ce69110-4fbb-44b2-9739-edc7755d8316 Superblock backups stored on blocks: 8193 Allocating group tables: 0/2 done Writing inode tables: 0/2 done Writing superblocks and filesystem accounting information: 0/2 done o #4: insn #48 against 'ringbuf' libbpf: prog 'kernel_read_file': found map 0 (ringbuf, sec 8, off 0) for insn #48 libbpf: loading kernel BTF '/sys/kernel/btf/vmlinux': 0 libbpf: map 'ringbuf': created successfully, fd=5 libbpf: map 'ima.bss': created successfully, fd=6 libbpf: sec 'lsm.s/bprm_committed_creds': found 2 CO-RE relocations libbpf: CO-RE relocating [13] struct linux_binprm: found target candidate [6113] struct linux_binprm in [vmlinux] libbpf: prog 'bprm_committed_creds': relo #0: [13] struct linux_binprm.file (0:11 @ offset 64) libbpf: prog 'bprm_committed_creds': relo #0: matching candidate #0 [6113] struct linux_binprm.file (0:11 @ offset 64) libbpf: prog 'bprm_committed_creds': relo #0: patched insn #1 (LDX/ST/STX) off 64 -> 64 libbpf: CO-RE relocating [19] struct file: found target candidate [615] struct file in [vmlinux] libbpf: prog 'bprm_committed_creds': relo #1: [19] struct file.f_inode (0:2 @ offset 32) libbpf: prog 'bprm_committed_creds': relo #1: matching candidate #0 [615] struct file.f_inode (0:2 @ offset 32) libbpf: prog 'bprm_committed_creds': relo #1: patched insn #14 (LDX/ST/STX) off 32 -> 32 libbpf: sec 'lsm.s/bprm_creds_for_exec': found 2 CO-RE relocations libbpf: prog 'bprm_creds_for_exec': relo #0: [13] struct linux_binprm.file (0:11 @ offset 64) libbpf: prog 'bprm_creds_for_exec': relo #0: matching candidate #0 [6113] struct linux_binprm.file (0:11 @ offset 64) libbpf: prog 'bprm_creds_for_exec': relo #0: patched insn #5 (LDX/ST/STX) off 64 -> 64 libbpf: prog 'bprm_creds_for_exec': relo #1: [19] struct file.f_inode (0:2 @ offset 32) libbpf: prog 'bprm_creds_for_exec': relo #1: matching candidate #0 [615] struct file.f_inode (0:2 @ offset 32) libbpf: prog 'bprm_creds_for_exec': relo #1: patched insn #18 (LDX/ST/STX) off 32 -> 32 libbpf: sec 'lsm.s/kernel_read_file': found 1 CO-RE relocations libbpf: prog 'kernel_read_file': relo #0: [19] struct file.f_inode (0:2 @ offset 32) libbpf: prog 'kernel_read_file': relo #0: matching candidate #0 [615] struct file.f_inode (0:2 @ offset 32) libbpf: prog 'kernel_read_file': relo #0: patched insn #31 (LDX/ST/STX) off 32 -> 32 test_test_ima:PASS:skel_load 0 nsec test_test_ima:PASS:ringbuf 0 nsec test_test_ima:PASS:attach 0 nsec test_test_ima:PASS:mkdtemp 0 nsec test_test_ima:PASS:failed to run command 0 nsec test_test_ima:PASS:run_measured_process #1 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 2 != expected 1 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:run_measured_process #2 0 nsec test_test_ima:PASS:num_samples_or_err 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:modify-bin #3 0 nsec test_test_ima:PASS:run_measured_process #3 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual -28 != expected 2 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:FAIL:sample_equal_or_err unexpected sample_equal_or_err: actual -5991112663362547186 != expected 5709380419881618400 test_test_ima:PASS:sample_different_or_err 0 nsec test_test_ima:PASS:run_measured_process #4 0 nsec test_test_ima:PASS:num_samples_or_err 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:sample_different_or_err 0 nsec test_test_ima:PASS:sample_equal_or_err 0 nsec test_test_ima:PASS:restore-bin #3 0 nsec test_test_ima:PASS:run_measured_process #5 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 3 != expected 2 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:run_measured_process #6 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 1 != expected 0 test_test_ima:PASS:failed to run command 0 nsec #190 test_ima:FAIL Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED Successfully unloaded bpf_testmod.ko. :: [ FAIL ] :: Command './test_progs -vv -t test_ima' (Expected 0, got 1, score 2) [17:49:29][root@250.1976_762998096.el9.x86_64+debug]# './test_progs-no_alu32 -t test_ima' test_test_ima:PASS:skel_load 0 nsec test_test_ima:PASS:ringbuf 0 nsec test_test_ima:PASS:attach 0 nsec test_test_ima:PASS:mkdtemp 0 nsec test_test_ima:PASS:failed to run command 0 nsec test_test_ima:PASS:run_measured_process #1 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 2 != expected 1 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:run_measured_process #2 0 nsec test_test_ima:PASS:num_samples_or_err 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:modify-bin #3 0 nsec test_test_ima:PASS:run_measured_process #3 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual -28 != expected 2 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:FAIL:sample_equal_or_err unexpected sample_equal_or_err: actual -5991112663362547186 != expected 5709380419881618400 test_test_ima:PASS:sample_different_or_err 0 nsec test_test_ima:PASS:run_measured_process #4 0 nsec test_test_ima:PASS:num_samples_or_err 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:sample_different_or_err 0 nsec test_test_ima:PASS:sample_equal_or_err 0 nsec test_test_ima:PASS:restore-bin #3 0 nsec test_test_ima:PASS:run_measured_process #5 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 3 != expected 2 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:run_measured_process #6 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 1 != expected 0 test_test_ima:PASS:failed to run command 0 nsec #190 test_ima:FAIL All error logs: test_test_ima:PASS:skel_load 0 nsec test_test_ima:PASS:ringbuf 0 nsec test_test_ima:PASS:attach 0 nsec test_test_ima:PASS:mkdtemp 0 nsec test_test_ima:PASS:failed to run command 0 nsec test_test_ima:PASS:run_measured_process #1 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 2 != expected 1 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:run_measured_process #2 0 nsec test_test_ima:PASS:num_samples_or_err 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:modify-bin #3 0 nsec test_test_ima:PASS:run_measured_process #3 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual -28 != expected 2 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:FAIL:sample_equal_or_err unexpected sample_equal_or_err: actual -5991112663362547186 != expected 5709380419881618400 test_test_ima:PASS:sample_different_or_err 0 nsec test_test_ima:PASS:run_measured_process #4 0 nsec test_test_ima:PASS:num_samples_or_err 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:sample_different_or_err 0 nsec test_test_ima:PASS:sample_equal_or_err 0 nsec test_test_ima:PASS:restore-bin #3 0 nsec test_test_ima:PASS:run_measured_process #5 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 3 != expected 2 test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:ima_hash 0 nsec test_test_ima:PASS:run_measured_process #6 0 nsec test_test_ima:FAIL:num_samples_or_err unexpected num_samples_or_err: actual 1 != expected 0 test_test_ima:PASS:failed to run command 0 nsec #190 test_ima:FAIL Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED :: [ FAIL ] :: Command './test_progs-no_alu32 -t test_ima' (Expected 0, got 1, score 2) === Dmesg result === [14107.869926] loop: module loaded [14107.879399] loop0: detected capacity change from 0 to 20480 [14108.396295] EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem [14108.402731] EXT4-fs (loop0): mounted filesystem without journal. Quota mode: none. [14108.467786] ima: policy update completed [14108.748247] ima: policy update completed [14108.787074] ima: Unable to open file: /tmp/ima_measureds2xIGy/mnt/policy_test (-1) [14108.787585] ima: policy update failed [14109.604395] loop0: detected capacity change from 0 to 20480 [14109.696854] EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem [14109.707387] EXT4-fs (loop0): mounted filesystem without journal. Quota mode: none. [14109.769648] ima: policy update completed [14110.007137] ima: policy update completed [14110.043028] ima: Unable to open file: /tmp/ima_measuredbU8EZA/mnt/policy_test (-1) [14110.043531] ima: policy update failed [14110.860392] loop0: detected capacity change from 0 to 20480 [14110.947584] EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem [14110.953028] EXT4-fs (loop0): mounted filesystem without journal. Quota mode: none. [14111.008233] ima: policy update completed [14111.246190] ima: policy update completed [14111.281810] ima: Unable to open file: /tmp/ima_measuredtNuaWV/mnt/policy_test (-1) [14111.282327] ima: policy update failed :: [ FAIL ] :: Test '189..253 selftests: bpf_test_progs:test_ima [FAIL]'