================================================================================ UBSAN: array-index-out-of-bounds in kernel/bpf/helpers.c:736:13 index -2 is out of range for type 'char[3][512]' CPU: 1 PID: 82 Comm: syslogd Not tainted 5.15.149-syzkaller-00490-g5d96939590c0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 dump_stack+0x15/0x17 lib/dump_stack.c:113 ubsan_epilogue lib/ubsan.c:151 [inline] __ubsan_handle_out_of_bounds+0x118/0x140 lib/ubsan.c:282 try_get_fmt_tmp_buf kernel/bpf/helpers.c:736 [inline] bpf_bprintf_prepare+0x132e/0x1360 kernel/bpf/helpers.c:778 ____bpf_trace_printk kernel/trace/bpf_trace.c:377 [inline] bpf_trace_printk+0x14a/0x300 kernel/trace/bpf_trace.c:368 bpf_prog_0605f9f479290f07+0x2f/0xd58 bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline] __bpf_prog_run include/linux/filter.h:625 [inline] bpf_prog_run include/linux/filter.h:632 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1883 [inline] bpf_trace_run3+0x11e/0x250 kernel/trace/bpf_trace.c:1921 __bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:138 __traceiter_kmem_cache_free+0x32/0x50 include/trace/events/kmem.h:138 trace_kmem_cache_free include/trace/events/kmem.h:138 [inline] kmem_cache_free+0x2c3/0x2e0 mm/slub.c:3536 kfree_skbmem+0x104/0x170 __kfree_skb net/core/skbuff.c:758 [inline] consume_skb+0xb4/0x250 net/core/skbuff.c:930 skb_free_datagram+0x28/0xe0 net/core/datagram.c:325 __unix_dgram_recvmsg+0xcb1/0x1260 net/unix/af_unix.c:2394 unix_dgram_recvmsg+0xc4/0xe0 net/unix/af_unix.c:2412 sock_recvmsg_nosec net/socket.c:966 [inline] sock_recvmsg net/socket.c:984 [inline] sock_read_iter+0x353/0x480 net/socket.c:1057 call_read_iter include/linux/fs.h:2196 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0xa7e/0xd40 fs/read_write.c:485 ksys_read+0x199/0x2c0 fs/read_write.c:623 __do_sys_read fs/read_write.c:633 [inline] __se_sys_read fs/read_write.c:631 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:631 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fd01b8b6b6a Code: 00 3d 00 00 41 00 75 0d 50 48 8d 3d 2d 08 0a 00 e8 ea 7d 01 00 31 c0 e9 07 ff ff ff 64 8b 04 25 18 00 00 00 85 c0 75 1b 0f 05 <48> 3d 00 f0 ff ff 76 6c 48 8b 15 8f a2 0d 00 f7 d8 64 89 02 48 83 RSP: 002b:00007ffefebf9028 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fd01b8b6b6a RDX: 00000000000000ff RSI: 0000562e8fd82300 RDI: 0000000000000000 RBP: 0000562e8fd822c0 R08: 0000000000000001 R09: 0000000000000000 R10: 00007fd01ba553a3 R11: 0000000000000246 R12: 0000562e8fd8235f R13: 0000562e8fd82300 R14: 0000000000000000 R15: 00007fd01ba93a80 ================================================================================