syzbot


general protection fault in __unmap_hugepage_range_final

Status: fixed on 2024/01/11 06:28
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+b2c92cdf120616d1f63b@syzkaller.appspotmail.com
Fix commit: 574a6db80f3e hugetlb: fix null-ptr-deref in hugetlb_vma_lock_write
First crash: 186d, last: 147d
Fix bisection: fixed by (bisect log) :
commit 574a6db80f3eff7cb3a27aa92d126a69895a285d
Author: Mike Kravetz <mike.kravetz@oracle.com>
Date: Tue Nov 14 01:20:33 2023 +0000

  hugetlb: fix null-ptr-deref in hugetlb_vma_lock_write

  
Bug presence (2)
Date Name Commit Repro Result
2023/11/03 upstream (ToT) e392ea4d4d00 C [report] general protection fault in __hugetlb_zap_begin
2023/12/19 upstream (ToT) 2cf4f94d8e86 C Didn't crash
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in __unmap_hugepage_range_final mm 1 537d 532d 0/26 auto-obsoleted due to no activity on 2023/03/16 02:28

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc000000001d: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000000e8-0x00000000000000ef]
CPU: 0 PID: 3556 Comm: syz-executor311 Not tainted 6.1.61-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
RIP: 0010:__lock_acquire+0x69/0x1f80 kernel/locking/lockdep.c:4918
Code: df 0f b6 04 10 84 c0 0f 85 fb 15 00 00 83 3d 31 17 09 0d 00 0f 84 a8 14 00 00 83 3d e0 30 95 0b 00 74 2b 4c 89 f0 48 c1 e8 03 <80> 3c 10 00 74 12 4c 89 f7 e8 29 76 77 00 48 ba 00 00 00 00 00 fc
RSP: 0018:ffffc90003adf6a0 EFLAGS: 00010006

RAX: 000000000000001d RBX: 0000000000000000 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000000 RDI: 00000000000000e8
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: ffff88807a2b0000 R14: 00000000000000e8 R15: 0000000000000001
FS:  0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555573b0ca8 CR3: 00000000768ac000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5661
 down_write+0x36/0x60 kernel/locking/rwsem.c:1573
 __unmap_hugepage_range_final+0x13d/0x5a0 mm/hugetlb.c:5430
 unmap_vmas+0x48b/0x640 mm/memory.c:1730
 exit_mmap+0x252/0x9f0 mm/mmap.c:3214
 __mmput+0x115/0x3c0 kernel/fork.c:1199
 exit_mm+0x226/0x300 kernel/exit.c:563
 do_exit+0x9f6/0x26a0 kernel/exit.c:856
 __do_sys_exit kernel/exit.c:986 [inline]
 __se_sys_exit kernel/exit.c:984 [inline]
 __x64_sys_exit+0x3c/0x40 kernel/exit.c:984
 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+0x63/0xcd
RIP: 0033:0x7f4a852fda79
Code: Unable to access opcode bytes at 0x7f4a852fda4f.
RSP: 002b:00007ffe33e8b878 EFLAGS: 00000246 ORIG_RAX: 000000000000003c
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f4a852fda79
RDX: 00007f4a853373b3 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 000000000000cd02 R08: 0000000000000000 R09: 0000000000000006
R10: 0000000020000000 R11: 0000000000000246 R12: 00007ffe33e8b88c
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__lock_acquire+0x69/0x1f80 kernel/locking/lockdep.c:4918
Code: df 0f b6 04 10 84 c0 0f 85 fb 15 00 00 83 3d 31 17 09 0d 00 0f 84 a8 14 00 00 83 3d e0 30 95 0b 00 74 2b 4c 89 f0 48 c1 e8 03 <80> 3c 10 00 74 12 4c 89 f7 e8 29 76 77 00 48 ba 00 00 00 00 00 fc
RSP: 0018:ffffc90003adf6a0 EFLAGS: 00010006
RAX: 000000000000001d RBX: 0000000000000000 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000000 RDI: 00000000000000e8
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: ffff88807a2b0000 R14: 00000000000000e8 R15: 0000000000000001
FS:  0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555573b0ca8 CR3: 00000000768ac000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	df 0f                	fisttps (%rdi)
   2:	b6 04                	mov    $0x4,%dh
   4:	10 84 c0 0f 85 fb 15 	adc    %al,0x15fb850f(%rax,%rax,8)
   b:	00 00                	add    %al,(%rax)
   d:	83 3d 31 17 09 0d 00 	cmpl   $0x0,0xd091731(%rip)        # 0xd091745
  14:	0f 84 a8 14 00 00    	je     0x14c2
  1a:	83 3d e0 30 95 0b 00 	cmpl   $0x0,0xb9530e0(%rip)        # 0xb953101
  21:	74 2b                	je     0x4e
  23:	4c 89 f0             	mov    %r14,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	80 3c 10 00          	cmpb   $0x0,(%rax,%rdx,1) <-- trapping instruction
  2e:	74 12                	je     0x42
  30:	4c 89 f7             	mov    %r14,%rdi
  33:	e8 29 76 77 00       	call   0x777661
  38:	48                   	rex.W
  39:	ba 00 00 00 00       	mov    $0x0,%edx
  3e:	00 fc                	add    %bh,%ah

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/03 18:54 linux-6.1.y 4a61839152cc c4ac074c .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/12/11 12:25 linux-6.1.y e7cddbb41b63 28b24332 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/12/11 03:35 linux-6.1.y 6c6a6c7e211c 28b24332 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/12/06 19:50 linux-6.1.y c6114c845984 e3299f55 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/11/28 07:16 linux-6.1.y 69e434a1cb21 9fe51b7c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/11/24 00:37 linux-6.1.y 69e434a1cb21 5b429f39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/11/10 13:45 linux-6.1.y fb2635ac69ab 45e9b83e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/11/06 16:18 linux-6.1.y 4a61839152cc 78fae24e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/11/06 15:17 linux-6.1.y 4a61839152cc 78fae24e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/11/03 23:47 linux-6.1.y 4a61839152cc 500bfdc4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/11/02 22:51 linux-6.1.y 4a61839152cc c4ac074c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/11/02 16:08 linux-6.1.y 4a61839152cc 69904c9f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
2023/11/02 11:08 linux-6.1.y 4a61839152cc 69904c9f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in __unmap_hugepage_range_final
* Struck through repros no longer work on HEAD.