syzbot


BUG: unable to handle kernel paging request in hash

Status: upstream: reported C repro on 2024/04/02 17:12
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+478c1c0addba4f4ce6d1@syzkaller.appspotmail.com
First crash: 246d, last: 245d
Fix commit to backport (bisect log) :
tree: upstream
commit a8d89feba7e54e691ca7c4efc2a6264fa83f3687
Author: Andrei Matei <andreimatei1@gmail.com>
Date: Wed Mar 27 02:42:44 2024 +0000

  bpf: Check bloom filter map value size

  
Bug presence (2)
Date Name Commit Repro Result
2024/05/01 linux-6.1.y (ToT) dcbc050cb0d3 C [report] INFO: rcu detected stall in corrupted
2024/05/01 upstream (ToT) 18daea77cca6 C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: stack-out-of-bounds Read in hash bpf C done 5 235d 242d 25/28 fixed on 2024/05/23 00:16
android-6-1 KASAN: stack-out-of-bounds Read in hash origin:lts C done 97 135d 246d 0/2 auto-obsoleted due to no activity on 2024/09/30 08:33
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2024/06/29 17:54 7h37m fix candidate upstream OK (1) job log
2024/05/03 05:24 12h11m (2) fix candidate upstream error job log

Sample crash report:
BUG: unable to handle page fault for address: ffffc90003a20000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 12400067 
P4D 12400067 
PUD 1261d067 
PMD 1ea41067 
PTE 0

Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 3545 Comm: syz-executor215 Not tainted 6.1.83-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
RIP: 0010:jhash2 include/linux/jhash.h:128 [inline]
RIP: 0010:hash+0x103/0xab0 kernel/bpf/bloom_filter.c:36
Code: e8 03 0f b6 04 10 84 c0 0f 85 b4 00 00 00 41 03 6c 24 f8 49 8d 7f 08 48 89 f8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 bc 00 00 00 <45> 03 6c 24 fc 44 29 eb 44 89 e8 c1 c0 04 31 d8 41 01 ed 89 c1 c1
RSP: 0018:ffffc90003a1fb58 EFLAGS: 00010292

RAX: 0000000000000000 RBX: 000000001f11dd37 RCX: ffffffff81a59ca4
RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffc90003a20000
RBP: 00000000a85c037c R08: ffffffff81a59b64 R09: fffffbfff2092e45
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90003a20004
R13: 00000000066f947f R14: 000000003ffffe81 R15: ffffc90003a1fff8
FS:  00005555570c1380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90003a20000 CR3: 0000000076e70000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bloom_map_peek_elem+0xb1/0x1b0 kernel/bpf/bloom_filter.c:51
 bpf_prog_00798911c748094f+0x3a/0x3e
 bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
 __bpf_prog_run include/linux/filter.h:603 [inline]
 bpf_prog_run include/linux/filter.h:610 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline]
 bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312
 __traceiter_ext4_drop_inode+0x6b/0xb0 include/trace/events/ext4.h:251
 trace_ext4_drop_inode include/trace/events/ext4.h:251 [inline]
 ext4_drop_inode+0x256/0x2e0 fs/ext4/super.c:1365
 iput_final fs/inode.c:1761 [inline]
 iput+0x4ca/0x980 fs/inode.c:1817
 do_unlinkat+0x509/0x820 fs/namei.c:4399
 __do_sys_unlink fs/namei.c:4440 [inline]
 __se_sys_unlink fs/namei.c:4438 [inline]
 __x64_sys_unlink+0x45/0x50 fs/namei.c:4438
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f7e51025fc7
Code: 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 57 00 00 00 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:00007ffea6f4abd8 EFLAGS: 00000206
 ORIG_RAX: 0000000000000057
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7e51025fc7
RDX: 00007ffea6f4ac00 RSI: 00007ffea6f4ac90 RDI: 00007ffea6f4ac90
RBP: 00007ffea6f4ac90 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000100 R11: 0000000000000206 R12: 00007ffea6f4bd00
R13: 00005555570c26c0 R14: 00007ffea6f4bd00 R15: 0000000000000002
 </TASK>
Modules linked in:
CR2: ffffc90003a20000
---[ end trace 0000000000000000 ]---
RIP: 0010:jhash2 include/linux/jhash.h:128 [inline]
RIP: 0010:hash+0x103/0xab0 kernel/bpf/bloom_filter.c:36
Code: e8 03 0f b6 04 10 84 c0 0f 85 b4 00 00 00 41 03 6c 24 f8 49 8d 7f 08 48 89 f8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 bc 00 00 00 <45> 03 6c 24 fc 44 29 eb 44 89 e8 c1 c0 04 31 d8 41 01 ed 89 c1 c1
RSP: 0018:ffffc90003a1fb58 EFLAGS: 00010292

RAX: 0000000000000000 RBX: 000000001f11dd37 RCX: ffffffff81a59ca4
RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffc90003a20000
RBP: 00000000a85c037c R08: ffffffff81a59b64 R09: fffffbfff2092e45
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90003a20004
R13: 00000000066f947f R14: 000000003ffffe81 R15: ffffc90003a1fff8
FS:  00005555570c1380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90003a20000 CR3: 0000000076e70000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	e8 03 0f b6 04       	call   0x4b60f08
   5:	10 84 c0 0f 85 b4 00 	adc    %al,0xb4850f(%rax,%rax,8)
   c:	00 00                	add    %al,(%rax)
   e:	41 03 6c 24 f8       	add    -0x8(%r12),%ebp
  13:	49 8d 7f 08          	lea    0x8(%r15),%rdi
  17:	48 89 f8             	mov    %rdi,%rax
  1a:	48 c1 e8 03          	shr    $0x3,%rax
  1e:	0f b6 04 10          	movzbl (%rax,%rdx,1),%eax
  22:	84 c0                	test   %al,%al
  24:	0f 85 bc 00 00 00    	jne    0xe6
* 2a:	45 03 6c 24 fc       	add    -0x4(%r12),%r13d <-- trapping instruction
  2f:	44 29 eb             	sub    %r13d,%ebx
  32:	44 89 e8             	mov    %r13d,%eax
  35:	c1 c0 04             	rol    $0x4,%eax
  38:	31 d8                	xor    %ebx,%eax
  3a:	41 01 ed             	add    %ebp,%r13d
  3d:	89 c1                	mov    %eax,%ecx
  3f:	c1                   	.byte 0xc1

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/02 17:11 linux-6.1.y e5cd595e23c1 eb2966c4 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf BUG: unable to handle kernel paging request in hash
2024/04/03 09:32 linux-6.1.y e5cd595e23c1 7925100d .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf KASAN: stack-out-of-bounds Read in hash
* Struck through repros no longer work on HEAD.