[syzbot] [bpf?] WARNING in bpf_map_lookup_percpu_elem

From: syzbot
Date: Mon Apr 29 2024 - 16:22:44 EST


Hello,

syzbot found the following issue on:

HEAD commit: e33c4963bf53 Merge tag 'nfsd-6.9-5' of git://git.kernel.or..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=16023d30980000
kernel config: https://syzkaller.appspot.com/x/.config?x=545d4b3e07d6ccbc
dashboard link: https://syzkaller.appspot.com/bug?extid=dce5aae19ae4d6399986
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1529956b180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10e35aa0980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e0ce27d8874a/disk-e33c4963.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b4f35a65c416/vmlinux-e33c4963.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f1c3abd538d5/bzImage-e33c4963.xz

The issue was bisected to:

commit 07343110b293456d30393e89b86c4dee1ac051c8
Author: Feng Zhou <zhoufeng.zf@xxxxxxxxxxxxx>
Date: Wed May 11 09:38:53 2022 +0000

bpf: add bpf_map_lookup_percpu_elem for percpu map

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=10c20c08980000
final oops: https://syzkaller.appspot.com/x/report.txt?x=12c20c08980000
console output: https://syzkaller.appspot.com/x/log.txt?x=14c20c08980000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+dce5aae19ae4d6399986@xxxxxxxxxxxxxxxxxxxxxxxxx
Fixes: 07343110b293 ("bpf: add bpf_map_lookup_percpu_elem for percpu map")

------------[ cut here ]------------
WARNING: CPU: 1 PID: 5075 at kernel/bpf/helpers.c:132 ____bpf_map_lookup_percpu_elem kernel/bpf/helpers.c:132 [inline]
WARNING: CPU: 1 PID: 5075 at kernel/bpf/helpers.c:132 bpf_map_lookup_percpu_elem+0xa8/0xc0 kernel/bpf/helpers.c:130
Modules linked in:
CPU: 1 PID: 5075 Comm: syz-executor426 Not tainted 6.9.0-rc5-syzkaller-00053-ge33c4963bf53 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
RIP: 0010:____bpf_map_lookup_percpu_elem kernel/bpf/helpers.c:132 [inline]
RIP: 0010:bpf_map_lookup_percpu_elem+0xa8/0xc0 kernel/bpf/helpers.c:130
Code: 41 5c 41 5d ff e0 cc 66 90 e8 24 8f e5 ff e8 6f 12 cb ff 31 ff 41 89 c4 89 c6 e8 f3 89 e5 ff 45 85 e4 75 8c e8 09 8f e5 ff 90 <0f> 0b 90 eb 81 48 89 df e8 db b7 40 00 eb 93 e8 d4 b7 40 00 eb ae
RSP: 0018:ffffc90003187a80 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff88801b299000 RCX: ffffffff81a8333d
RDX: ffff888026ff5a00 RSI: ffffffff81a83347 RDI: 0000000000000005
RBP: 0000000000500100 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffffc90003187b38 R14: 0000000000000000 R15: 0000000000000000
FS: 0000555561e24380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005606a936e0c8 CR3: 000000007ab28000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
___bpf_prog_run+0x3e51/0xabd0 kernel/bpf/core.c:1997
__bpf_prog_run32+0xc1/0x100 kernel/bpf/core.c:2236
bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
__bpf_prog_run include/linux/filter.h:657 [inline]
bpf_prog_run include/linux/filter.h:664 [inline]
bpf_prog_run_pin_on_cpu include/linux/filter.h:681 [inline]
bpf_prog_test_run_syscall+0x3ae/0x770 net/bpf/test_run.c:1509
bpf_prog_test_run kernel/bpf/syscall.c:4269 [inline]
__sys_bpf+0xd56/0x4b40 kernel/bpf/syscall.c:5678
__do_sys_bpf kernel/bpf/syscall.c:5767 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5765 [inline]
__x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5765
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f7bd6870669
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 00 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 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc4a73bd48 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007ffc4a73bf18 RCX: 00007f7bd6870669
RDX: 000000000000000c RSI: 00000000200004c0 RDI: 000000000000000a
RBP: 00007f7bd68e3610 R08: 00007ffc4a73bf18 R09: 00007ffc4a73bf18
R10: 00007ffc4a73bf18 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc4a73bf08 R14: 0000000000000001 R15: 0000000000000001
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxx.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup