[v5.15] BUG: unable to handle kernel paging request in bpf_probe_read_compat_str

1 view
Skip to first unread message

syzbot

unread,
Jan 22, 2024, 6:41:23 PMJan 22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ddcaf4999061 Linux 5.15.147
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=174bfa3de80000
kernel config: https://syzkaller.appspot.com/x/.config?x=8c65db3d25098c3c
dashboard link: https://syzkaller.appspot.com/bug?extid=3b4268501e3bacda8434
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11ae066fe80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14274b15e80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/33608a58aade/disk-ddcaf499.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f475952349f9/vmlinux-ddcaf499.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0875b18fba29/bzImage-ddcaf499.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+3b4268...@syzkaller.appspotmail.com

BUG: unable to handle page fault for address: ffffffffff600000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0001) - permissions violation
PGD c691067 P4D c691067 PUD c693067 PMD c6b6067 PTE 800000000c609165
Oops: 0001 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 3501 Comm: syz-executor352 Not tainted 5.15.147-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:strncpy_from_kernel_nofault+0x89/0x1c0 mm/maccess.c:92
Code: 00 48 89 d0 48 c1 e8 03 48 89 44 24 10 0f b6 04 28 84 c0 48 89 14 24 0f 85 d5 00 00 00 ff 02 45 31 f6 49 89 df 48 8b 54 24 08 <42> 8a 1c 33 4a 8d 3c 32 48 89 f8 48 c1 e8 03 49 89 ec 0f b6 04 28
RSP: 0018:ffffc90002de7898 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffffffffff600000 RCX: ffff88807d679dc0
RDX: ffffc90002de7928 RSI: ffffffffff600000 RDI: ffffffffff600000
RBP: dffffc0000000000 R08: ffffffff8139a0b9 R09: ffffed100facf3b9
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffffff600000
R13: 0000000000000008 R14: 0000000000000000 R15: ffffffffff600000
FS: 00005555571a3380(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000001952b000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
bpf_probe_read_kernel_str_common kernel/trace/bpf_trace.c:255 [inline]
____bpf_probe_read_compat_str kernel/trace/bpf_trace.c:303 [inline]
bpf_probe_read_compat_str+0x10a/0x180 kernel/trace/bpf_trace.c:296
bpf_prog_f17ebaf3f5f7baf8+0x3a/0x624
bpf_dispatcher_nop_func include/linux/bpf.h:776 [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+0x1d1/0x380 kernel/trace/bpf_trace.c:1921
trace_sched_switch include/trace/events/sched.h:220 [inline]
__schedule+0x1e8d/0x45b0 kernel/sched/core.c:6373
schedule+0x11b/0x1f0 kernel/sched/core.c:6459
freezable_schedule include/linux/freezer.h:172 [inline]
do_nanosleep+0x1bc/0x7b0 kernel/time/hrtimer.c:2044
hrtimer_nanosleep+0x24d/0x490 kernel/time/hrtimer.c:2097
__do_sys_clock_nanosleep kernel/time/posix-timers.c:1308 [inline]
__se_sys_clock_nanosleep+0x323/0x3b0 kernel/time/posix-timers.c:1285
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:0x7f5f564a1473
Code: 00 00 00 00 0f 1f 00 83 ff 03 74 7b 83 ff 02 b8 fa ff ff ff 49 89 ca 0f 44 f8 80 3d ee db 03 00 00 74 14 b8 e6 00 00 00 0f 05 <f7> d8 c3 66 2e 0f 1f 84 00 00 00 00 00 48 83 ec 28 48 89 54 24 10
RSP: 002b:00007fff1abcc248 EFLAGS: 00000202 ORIG_RAX: 00000000000000e6
RAX: ffffffffffffffda RBX: 0000000000000dae RCX: 00007f5f564a1473
RDX: 00007fff1abcc260 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 000000000000a11e R08: 00007fff1abeb0b0 R09: 0000000000000010
R10: 0000000000000000 R11: 0000000000000202 R12: 00007fff1abcc29c
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
</TASK>
Modules linked in:
CR2: ffffffffff600000
---[ end trace d0f7278ca5dae17e ]---
RIP: 0010:strncpy_from_kernel_nofault+0x89/0x1c0 mm/maccess.c:92
Code: 00 48 89 d0 48 c1 e8 03 48 89 44 24 10 0f b6 04 28 84 c0 48 89 14 24 0f 85 d5 00 00 00 ff 02 45 31 f6 49 89 df 48 8b 54 24 08 <42> 8a 1c 33 4a 8d 3c 32 48 89 f8 48 c1 e8 03 49 89 ec 0f b6 04 28
RSP: 0018:ffffc90002de7898 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffffffffff600000 RCX: ffff88807d679dc0
RDX: ffffc90002de7928 RSI: ffffffffff600000 RDI: ffffffffff600000
RBP: dffffc0000000000 R08: ffffffff8139a0b9 R09: ffffed100facf3b9
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffffff600000
R13: 0000000000000008 R14: 0000000000000000 R15: ffffffffff600000
FS: 00005555571a3380(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000001952b000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 00 48 89 add %cl,-0x77(%rax)
3: d0 48 c1 rorb -0x3f(%rax)
6: e8 03 48 89 44 call 0x4489480e
b: 24 10 and $0x10,%al
d: 0f b6 04 28 movzbl (%rax,%rbp,1),%eax
11: 84 c0 test %al,%al
13: 48 89 14 24 mov %rdx,(%rsp)
17: 0f 85 d5 00 00 00 jne 0xf2
1d: ff 02 incl (%rdx)
1f: 45 31 f6 xor %r14d,%r14d
22: 49 89 df mov %rbx,%r15
25: 48 8b 54 24 08 mov 0x8(%rsp),%rdx
* 2a: 42 8a 1c 33 mov (%rbx,%r14,1),%bl <-- trapping instruction
2e: 4a 8d 3c 32 lea (%rdx,%r14,1),%rdi
32: 48 89 f8 mov %rdi,%rax
35: 48 c1 e8 03 shr $0x3,%rax
39: 49 89 ec mov %rbp,%r12
3c: 0f b6 04 28 movzbl (%rax,%rbp,1),%eax


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Jan 23, 2024, 9:36:24 AMJan 23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8fd7f4462453 Linux 6.1.74
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=159d4993e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=641b679746d8a982
dashboard link: https://syzkaller.appspot.com/bug?extid=074dc22dbf0e3162a7ce
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=107ac1e3e80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1657bd73e80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/24f5d4f2d3a2/disk-8fd7f446.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c6421c24f432/vmlinux-8fd7f446.xz
kernel image: https://storage.googleapis.com/syzbot-assets/1b7d5b1f107b/bzImage-8fd7f446.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+074dc2...@syzkaller.appspotmail.com

BUG: unable to handle page fault for address: ffffffffff600000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD ce91067 P4D ce91067 PUD ce93067 PMD ceb6067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.1.74-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:strncpy_from_kernel_nofault+0x89/0x1c0 mm/maccess.c:91
Code: 00 48 89 d0 48 c1 e8 03 48 89 44 24 10 0f b6 04 28 84 c0 48 89 14 24 0f 85 d5 00 00 00 ff 02 45 31 f6 49 89 df 48 8b 54 24 08 <42> 8a 1c 33 4a 8d 3c 32 48 89 f8 48 c1 e8 03 49 89 ec 0f b6 04 28
RSP: 0018:ffffc90000177a78 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffffffffff600000 RCX: ffff88813fef1dc0
RDX: ffffc90000177b08 RSI: ffffffffff600000 RDI: ffffffffff600000
RBP: dffffc0000000000 R08: ffffffff813dd769 R09: ffffed1027fde3b9
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffffff600000
R13: 0000000000000008 R14: 0000000000000000 R15: ffffffffff600000
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000007a3bf000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
bpf_probe_read_kernel_str_common kernel/trace/bpf_trace.c:265 [inline]
____bpf_probe_read_compat_str kernel/trace/bpf_trace.c:313 [inline]
bpf_probe_read_compat_str+0x10a/0x180 kernel/trace/bpf_trace.c:306
bpf_prog_f17ebaf3f5f7baf8+0x3a/0x3c
bpf_dispatcher_nop_func include/linux/bpf.h:979 [inline]
__bpf_prog_run include/linux/filter.h:600 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2275 [inline]
bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2316
trace_sched_switch include/trace/events/sched.h:222 [inline]
__schedule+0x2116/0x4550 kernel/sched/core.c:6555
schedule_idle+0x4a/0x90 kernel/sched/core.c:6662
do_idle+0x62d/0x680 kernel/sched/idle.c:331
cpu_startup_entry+0x3d/0x60 kernel/sched/idle.c:401
start_secondary+0xe4/0xf0 arch/x86/kernel/smpboot.c:281
secondary_startup_64_no_verify+0xcf/0xdb
</TASK>
Modules linked in:
CR2: ffffffffff600000
---[ end trace 0000000000000000 ]---
RIP: 0010:strncpy_from_kernel_nofault+0x89/0x1c0 mm/maccess.c:91
Code: 00 48 89 d0 48 c1 e8 03 48 89 44 24 10 0f b6 04 28 84 c0 48 89 14 24 0f 85 d5 00 00 00 ff 02 45 31 f6 49 89 df 48 8b 54 24 08 <42> 8a 1c 33 4a 8d 3c 32 48 89 f8 48 c1 e8 03 49 89 ec 0f b6 04 28
RSP: 0018:ffffc90000177a78 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffffffffff600000 RCX: ffff88813fef1dc0
RDX: ffffc90000177b08 RSI: ffffffffff600000 RDI: ffffffffff600000
RBP: dffffc0000000000 R08: ffffffff813dd769 R09: ffffed1027fde3b9
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffffff600000
R13: 0000000000000008 R14: 0000000000000000 R15: ffffffffff600000
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000007a3bf000 CR4: 00000000003506e0

syzbot

unread,
Mar 10, 2024, 8:48:04 PMMar 10
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 32019c659ecfe1d92e3bf9fcdfbb11a7c70acd58
git tree: upstream
Author: Hou Tao <hou...@huawei.com>
Date: Fri Feb 2 10:39:34 2024 +0000

x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=158a721e180000
Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Mar 18, 2024, 3:50:05 AMMar 18
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 32019c659ecfe1d92e3bf9fcdfbb11a7c70acd58
git tree: upstream
Author: Hou Tao <hou...@huawei.com>
Date: Fri Feb 2 10:39:34 2024 +0000

x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=16778c81180000

syzbot

unread,
Mar 26, 2024, 8:53:05 PMMar 26
to syzkaller...@googlegroups.com
The commit that was suspected to fix the issue was backported to the fuzzed
kernel trees.

commit e8a67fe34b76a49320b33032228a794f40b0316b
Author: <hou...@huawei.com>
Date: Fri Feb 2 10:39:34 2024 +0000

x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()

If you believe this is correct, please reply with
#syz fix: x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()

The commit was initially detected here:

commit 32019c659ecfe1d92e3bf9fcdfbb11a7c70acd58
git tree: upstream
Author: Hou Tao <hou...@huawei.com>
Date: Fri Feb 2 10:39:34 2024 +0000

x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=16778c81180000

syzbot

unread,
Mar 26, 2024, 10:44:04 PMMar 26
to syzkaller...@googlegroups.com
The commit that was suspected to fix the issue was backported to the fuzzed
kernel trees.

commit f175de546a3eb77614d94d4c02550181c0a8493e
Author: <hou...@huawei.com>
Date: Fri Feb 2 10:39:34 2024 +0000

x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()

If you believe this is correct, please reply with
#syz fix: x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()

The commit was initially detected here:

commit 32019c659ecfe1d92e3bf9fcdfbb11a7c70acd58
git tree: upstream
Author: Hou Tao <hou...@huawei.com>
Date: Fri Feb 2 10:39:34 2024 +0000

x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=158a721e180000
Reply all
Reply to author
Forward
0 new messages