ubuntu_bpf #143/p bpf_get_stack return R0 within range Did not run the program (not supported) cause call trace on 5.15 kernel

Bug #1991346 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
New
Undecided
Unassigned
linux (Ubuntu)
Invalid
Undecided
Unassigned
Jammy
Incomplete
Undecided
Unassigned

Bug Description

Issue caught by sut-scan, this is not a regression as we are suffering from another build issue in the past.

Spotted on Jammy 5.15.0-50-generic and can be found on variants.

Step to reproduce:
1. Build the ubuntu_bpf test
2. Run the following in tools/testing/selftests/bpf:

$ sudo ./test_verifier 143
#143/p bpf_get_stack return R0 within range Did not run the program (not supported) OK
Summary: 1 PASSED, 0 SKIPPED, 0 FAILED

It will cause this call trace in dmesg:
[ 107.750735] ------------[ cut here ]------------
[ 107.750739] trace type BPF program uses run-time allocation
[ 107.750749] WARNING: CPU: 1 PID: 1429 at kernel/bpf/verifier.c:11449 check_map_prog_compatibility+0x231/0x2a0
[ 107.750755] Modules linked in: tls binfmt_misc nls_iso8859_1 input_leds serio_raw dm_multipath sch_fq_codel scsi_dh_rdac scsi_dh_emc scsi_dh_alua ipmi_devintf ipmi_msghandler msr drm efi_pstore ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd psmouse ixgbevf floppy
[ 107.750782] CPU: 1 PID: 1429 Comm: test_verifier Not tainted 5.15.0-1021-aws #25-Ubuntu
[ 107.750784] Hardware name: Xen HVM domU, BIOS 4.2.amazon 08/24/2006
[ 107.750786] RIP: 0010:check_map_prog_compatibility+0x231/0x2a0
[ 107.750788] Code: 50 3e 7f b7 4c 89 ef 41 be ea ff ff ff e8 47 d3 ff ff e9 e3 fe ff ff 48 c7 c7 c8 3c 7f b7 c6 05 98 41 fa 01 01 e8 f0 71 ab 00 <0f> 0b e9 0d ff ff ff 48 c7 c6 98 3d 7f b7 4c 89 ef 41 be ea ff ff
[ 107.750790] RSP: 0018:ffffaf4900b8bb20 EFLAGS: 00010282
[ 107.750791] RAX: 0000000000000000 RBX: ffffaf490006d000 RCX: 0000000000000027
[ 107.750793] RDX: ffff989fabe60588 RSI: 0000000000000001 RDI: ffff989fabe60580
[ 107.750794] RBP: ffffaf4900b8bb48 R08: 0000000000000003 R09: fffffffffffc9738
[ 107.750795] R10: 0000000000000031 R11: 0000000000000001 R12: ffff989ec3bffc00
[ 107.750796] R13: ffff989ec4a4c000 R14: 0000000000000005 R15: 0000000000000000
[ 107.750798] FS: 00007f46bb420000(0000) GS:ffff989fabe40000(0000) knlGS:0000000000000000
[ 107.750799] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 107.750800] CR2: 000055d91dc906fe CR3: 0000000003a4c002 CR4: 00000000001706e0
[ 107.750803] Call Trace:
[ 107.750804] <TASK>
[ 107.750807] resolve_pseudo_ldimm64+0x134/0x5e0
[ 107.750810] bpf_check+0x690/0xf00
[ 107.750813] bpf_prog_load+0x4c8/0xb10
[ 107.750817] __sys_bpf+0x1af/0xe20
[ 107.750820] __x64_sys_bpf+0x1a/0x30
[ 107.750823] do_syscall_64+0x5c/0xc0
[ 107.750827] ? handle_mm_fault+0xd8/0x2c0
[ 107.750831] ? do_user_addr_fault+0x1e7/0x670
[ 107.750836] ? exit_to_user_mode_prepare+0x37/0xb0
[ 107.750840] ? irqentry_exit_to_user_mode+0x9/0x20
[ 107.750843] ? irqentry_exit+0x1d/0x30
[ 107.750845] ? exc_page_fault+0x89/0x170
[ 107.750847] entry_SYSCALL_64_after_hwframe+0x61/0xcb
[ 107.750852] RIP: 0033:0x7f46bb53fa3d
[ 107.750854] Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c3 a3 0f 00 f7 d8 64 89 01 48
[ 107.750855] RSP: 002b:00007ffc86ae6d08 EFLAGS: 00000202 ORIG_RAX: 0000000000000141
[ 107.750857] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f46bb53fa3d
[ 107.750858] RDX: 0000000000000080 RSI: 00007ffc86ae6d90 RDI: 0000000000000005
[ 107.750859] RBP: 00007ffc86ae6d20 R08: 00007ffc86ae6c70 R09: 00007ffc86ae6d90
[ 107.750860] R10: 000000007fffffff R11: 0000000000000202 R12: 00007ffc86ae71b8
[ 107.750861] R13: 000055d91dc721dd R14: 000055d91dcdff38 R15: 00007f46bb6d1040
[ 107.750864] </TASK>
[ 107.750865] ---[ end trace 2da671b5c0dfc28b ]---

Po-Hsu Lin (cypressyew)
description: updated
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 1991346

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
Changed in linux (Ubuntu Jammy):
status: New → Incomplete
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Tested with the latest 5.15 mainline kernel 5.15.71-051571-generic, and this is still reproducible.

Changed in linux (Ubuntu):
status: Incomplete → 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.