syzbot


kernel BUG in free_bprm

Status: upstream: reported C repro on 2024/11/05 08:35
Subsystems: fs mm
[Documentation on labels]
Reported-by: syzbot+03e1af5c332f7e0eb84b@syzkaller.appspotmail.com
Fix commit: exec: NULL out bprm->argv0 when it is an ERR_PTR
Patched on: [ci-upstream-linux-next-kasan-gce-root], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 37d, last: 32d
Cause bisection: introduced by (bisect log) :
commit 7bdc6fc85c9a1008e00e624612f82932136d7545
Author: Tycho Andersen <tandersen@netflix.com>
Date: Wed Oct 30 20:37:31 2024 +0000

  exec: fix up /proc/pid/comm in the execveat(AT_EMPTY_PATH) case

Crash: kernel BUG in free_bprm (log)
Repro: C syz .config
  
Discussions (7)
Title Replies (including bot) Last reply
Re: [GIT PULL] execve updates for v6.13-rc1 1 (1) 2024/11/24 15:21
Re: [GIT PULL] execve updates for v6.13-rc1 1 (1) 2024/11/22 07:47
Re: [GIT PULL] execve updates for v6.13-rc1 16 (16) 2024/11/21 22:38
[GIT PULL] execve updates for v6.13-rc1 8 (8) 2024/11/21 02:51
[PATCH] exec: NULL out bprm->argv0 when it is an ERR_PTR 4 (4) 2024/11/06 09:39
[PATCH] exec: do not pass invalid pointer to kfree() from free_bprm() 4 (4) 2024/11/05 13:35
[syzbot] [fs?] [mm?] kernel BUG in free_bprm 1 (3) 2024/11/05 13:33
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/11/05 11:17 34m dmantipov@yandex.ru patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next 850f22c42f4b0a14a015aecc26f46f9948ded6dd OK log

Sample crash report:
process 'syz-executor994' launched '/dev/fd/4' with NULL argv: empty string added
------------[ cut here ]------------
kernel BUG at arch/x86/mm/physaddr.c:23!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 UID: 0 PID: 5849 Comm: syz-executor994 Not tainted 6.12.0-rc5-next-20241101-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:__phys_addr+0x16a/0x170 arch/x86/mm/physaddr.c:23
Code: 40 a8 7a 8e 4c 89 f6 4c 89 fa e8 b1 4d aa 03 e9 45 ff ff ff e8 a7 1a 52 00 90 0f 0b e8 9f 1a 52 00 90 0f 0b e8 97 1a 52 00 90 <0f> 0b 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc90003d27da0 EFLAGS: 00010293
RAX: ffffffff8143a369 RBX: 000000007ffffff2 RCX: ffff88807d558000
RDX: 0000000000000000 RSI: 000000007ffffff2 RDI: 000000001fffffff
RBP: 1ffff1100656f809 R08: ffffffff8143a305 R09: 1ffffffff203a1f6
R10: dffffc0000000000 R11: fffffbfff203a1f7 R12: dffffc0000000000
R13: fffffffffffffff2 R14: 000000007ffffff2 R15: ffff888074f4e958
FS:  0000555578474380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000001c550398 CR3: 0000000031980000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 virt_to_folio include/linux/mm.h:1294 [inline]
 kfree+0x71/0x420 mm/slub.c:4738
 free_bprm+0x2b5/0x300 fs/exec.c:1499
 do_execveat_common+0x3ae/0x750 fs/exec.c:1978
 do_execveat fs/exec.c:2061 [inline]
 __do_sys_execveat fs/exec.c:2135 [inline]
 __se_sys_execveat fs/exec.c:2129 [inline]
 __x64_sys_execveat+0xc4/0xe0 fs/exec.c:2129
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff0be8b0329
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:00007fffa1cbe9e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000142
RAX: ffffffffffffffda RBX: 00007fffa1cbebb8 RCX: 00007ff0be8b0329
RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000004
RBP: 00007ff0be923610 R08: 0000000000001000 R09: 00007fffa1cbebb8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fffa1cbeba8 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__phys_addr+0x16a/0x170 arch/x86/mm/physaddr.c:23
Code: 40 a8 7a 8e 4c 89 f6 4c 89 fa e8 b1 4d aa 03 e9 45 ff ff ff e8 a7 1a 52 00 90 0f 0b e8 9f 1a 52 00 90 0f 0b e8 97 1a 52 00 90 <0f> 0b 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc90003d27da0 EFLAGS: 00010293
RAX: ffffffff8143a369 RBX: 000000007ffffff2 RCX: ffff88807d558000
RDX: 0000000000000000 RSI: 000000007ffffff2 RDI: 000000001fffffff
RBP: 1ffff1100656f809 R08: ffffffff8143a305 R09: 1ffffffff203a1f6
R10: dffffc0000000000 R11: fffffbfff203a1f7 R12: dffffc0000000000
R13: fffffffffffffff2 R14: 000000007ffffff2 R15: ffff888074f4e958
FS:  0000555578474380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000001c550398 CR3: 0000000031980000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (445):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/02 02:47 linux-next c88416ba074a f00eed24 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/02 02:21 linux-next c88416ba074a f00eed24 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/01 20:27 linux-next c88416ba074a f00eed24 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/06 06:32 linux-next 850f22c42f4b 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/06 04:20 linux-next 850f22c42f4b 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/06 04:18 linux-next 850f22c42f4b 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/06 02:47 linux-next 850f22c42f4b 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/06 01:17 linux-next 850f22c42f4b 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/06 01:09 linux-next 850f22c42f4b 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/06 00:06 linux-next 850f22c42f4b 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/05 19:02 linux-next 850f22c42f4b 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/05 17:23 linux-next 850f22c42f4b 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/05 16:09 linux-next 850f22c42f4b 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/05 14:59 linux-next 850f22c42f4b 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/05 14:51 linux-next 850f22c42f4b 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/05 13:50 linux-next 850f22c42f4b 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/05 12:00 linux-next 850f22c42f4b 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/05 04:59 linux-next 1ffec08567f4 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/05 03:21 linux-next 1ffec08567f4 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/05 03:21 linux-next 1ffec08567f4 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/05 02:11 linux-next 1ffec08567f4 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/04 23:58 linux-next 1ffec08567f4 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/04 22:06 linux-next 1ffec08567f4 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/04 21:04 linux-next 1ffec08567f4 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/04 20:40 linux-next 1ffec08567f4 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/04 15:35 linux-next 1ffec08567f4 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/04 15:35 linux-next 1ffec08567f4 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/04 14:11 linux-next 1ffec08567f4 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/04 12:36 linux-next 1ffec08567f4 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/04 11:37 linux-next 1ffec08567f4 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/04 06:36 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/04 02:30 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 23:52 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 22:49 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 22:48 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 20:29 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 19:52 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 11:59 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 10:48 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 09:33 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 08:43 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 07:10 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 05:49 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 05:38 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/03 00:38 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
2024/11/02 20:58 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in free_bprm
* Struck through repros no longer work on HEAD.