Skip to contentSkip to conversation

general protection fault in unlink_file_vma

DISCUSSION linmiaohe 2 participants 2 messages Sep 14, 2020 – Sep 15, 2020 Memory management

lore
Share & tools
lore

linmiaohe

author
#0 lore raw

Tue, 08 Sep 2020 17:19:17 -0700

Quoted 52 lines

syzbot found the following issue on:

HEAD commit:    59126901 Merge tag 'perf-tools-fixes-for-v5.9-2020-09-03' ..
git tree:       upstream

console output:
https://syzkaller.appspot.com/x/log.txt?x=1166cb5d900000
kernel config:
https://syzkaller.appspot.com/x/.config?x=3c5f6ce8d5b68299

dashboard link: https://syzkaller.appspot.com/bug?extid=c5d5a51dcbb558ca0cb5
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11901e95900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15f56195900000

Bisection is inconclusive: the issue happens on the oldest tested release.

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1205faed900000
final oops:     https://syzkaller.appspot.com/x/report.txt?x=1105faed900000

console output:
https://syzkaller.appspot.com/x/log.txt?x=1605faed900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]
general protection fault, probably for non-canonical address 
0xe00eeaee0000003b: 0000 [#1] PREEMPT SMP KASAN
KASAN: maybe wild-memory-access in range 
[0x00777770000001d8-0x00777770000001df]
CPU: 1 PID: 10488 Comm: syz-executor721 Not tainted 
5.9.0-rc3-syzkaller #0 Hardware name: Google Google Compute 
Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:unlink_file_vma+0x57/0xb0 mm/mmap.c:164
Code: 4c 8b a5 a0 00 00 00 4d 85 e4 74 4e e8 92 d7 cd ff 49 8d bc 24 
d8 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 
02 00 75 3d 4d 8b b4 24 d8 01 00 00 4d 8d 6e 78 4c 89 ef e8
RSP: 0018:ffffc9000ac0f9b0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff88800010ceb0 RCX: ffffffff81592421
RDX: 000eeeee0000003b RSI: ffffffff81a6736e RDI: 00777770000001d8
RBP: ffff88800010ceb0 R08: 0000000000000001 R09: ffff88801291a50f
R10: ffffed10025234a1 R11: 0000000000000001 R12: 0077777000000000
R13: 00007f1eea0da000 R14: 00007f1eea0d9000 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8880ae700000(0000) 
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1eea11a9d0 CR3: 000000000007e000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call 
Trace:
 free_pgtables+0x1b3/0x2f0 mm/memory.c:415
 exit_mmap+0x2c0/0x530 mm/mmap.c:3184
 __mmput+0x122/0x470 kernel/fork.c:1076
 mmput+0x53/0x60 kernel/fork.c:1097
 exit_mm kernel/exit.c:483 [inline]
Quoted 8 lines
 do_exit+0xa8b/0x29f0 kernel/exit.c:793
 do_group_exit+0x125/0x310 kernel/exit.c:903
 get_signal+0x428/0x1f00 kernel/signal.c:2757
 arch_do_signal+0x82/0x2520 arch/x86/kernel/signal.c:811  
exit_to_user_mode_loop kernel/entry/common.c:136 [inline]
 exit_to_user_mode_prepare+0x1ae/0x200 kernel/entry/common.c:167
 syscall_exit_to_user_mode+0x7e/0x2e0 kernel/entry/common.c:242
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

#syz test: https://github.com/Linmiaohe/linux/ 796cd8f497d5b62b00667229375326381c32bdb3

syzbot
#1 lore raw
syzbot has tested the proposed patch but the reproducer is still triggering an issue: kernel panic: corrupted stack end in sys_nanosleep

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel panic: corrupted stack end in sys_nanosleep

Kernel panic - not syncing: corrupted stack end detected inside scheduler
CPU: 0 PID: 13791 Comm: syz-executor.4 Not tainted 5.9.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x198/0x1fd lib/dump_stack.c:118
 panic+0x347/0x7c0 kernel/panic.c:231
 schedule_debug kernel/sched/core.c:4278 [inline]
 __schedule+0x221e/0x2230 kernel/sched/core.c:4422
 schedule+0xd0/0x2a0 kernel/sched/core.c:4602
 freezable_schedule include/linux/freezer.h:172 [inline]
 do_nanosleep+0x222/0x650 kernel/time/hrtimer.c:1883
 hrtimer_nanosleep+0x1f9/0x430 kernel/time/hrtimer.c:1936
 __do_sys_nanosleep kernel/time/hrtimer.c:1970 [inline]
 __se_sys_nanosleep kernel/time/hrtimer.c:1957 [inline]
 __x64_sys_nanosleep+0x1dc/0x260 kernel/time/hrtimer.c:1957
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45ba81
Code: 75 14 b8 23 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 84 cf fb ff c3 48 83 ec 08 e8 ea 46 00 00 48 89 04 24 b8 23 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 33 47 00 00 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007ffca6cb6d70 EFLAGS: 00000293 ORIG_RAX: 0000000000000023
RAX: ffffffffffffffda RBX: 000000000002f226 RCX: 000000000045ba81
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007ffca6cb6d80
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000
R10: 00007ffca6cb6e80 R11: 0000000000000293 R12: 000000000118cf40
R13: 000000000118d940 R14: ffffffffffffffff R15: 000000000118cfec

Kernel Offset: disabled
Rebooting in 86400 seconds..

Tested on:

commit:         796cd8f4 fix gpf
git tree:       https://github.com/Linmiaohe/linux/
console output: https://syzkaller.appspot.com/x/log.txt?x=12b5d501900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=f82e58a6661a5ac4
dashboard link: https://syzkaller.appspot.com/bug?extid=c5d5a51dcbb558ca0cb5
compiler:       gcc (GCC) 10.1.0-syz 20200507