[Android 5.10] KASAN: vmalloc-out-of-bounds Read in load_module

0 views
Skip to first unread message

syzbot

unread,
Sep 27, 2024, 9:59:32 AMSep 27
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8d23314f588a Merge 5.10.225 into android13-5.10-lts
git tree: android13-5.10-lts
console+strace: https://syzkaller.appspot.com/x/log.txt?x=172d06a9980000
kernel config: https://syzkaller.appspot.com/x/.config?x=889d6bbfedaebd06
dashboard link: https://syzkaller.appspot.com/bug?extid=57348b2507bf71413cfb
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=11715e27980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10ad06a9980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/09c1893905da/disk-8d23314f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5294d841c477/vmlinux-8d23314f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a9c3f12eb021/bzImage-8d23314f.xz

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

==================================================================
BUG: KASAN: vmalloc-out-of-bounds in elf_validity_check kernel/module.c:3073 [inline]
BUG: KASAN: vmalloc-out-of-bounds in load_module+0x2a80/0x5aa0 kernel/module.c:4008
Read of size 1 at addr ffffc9000007afff by task syz-executor160/288

CPU: 1 PID: 288 Comm: syz-executor160 Not tainted 5.10.225-syzkaller-00513-g8d23314f588a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118
print_address_description+0x81/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:435 [inline]
kasan_report+0x179/0x1c0 mm/kasan/report.c:452
__asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306
elf_validity_check kernel/module.c:3073 [inline]
load_module+0x2a80/0x5aa0 kernel/module.c:4008
__do_sys_init_module kernel/module.c:4226 [inline]
__se_sys_init_module+0x238/0x2d0 kernel/module.c:4209
__x64_sys_init_module+0x76/0x80 kernel/module.c:4209
do_syscall_64+0x34/0x70
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f8ca80ef2a9
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:00007fffb8adb1e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000af
RAX: ffffffffffffffda RBX: 00007fffb8adb3c8 RCX: 00007f8ca80ef2a9
RDX: 0000000000000000 RSI: 0000000000000578 RDI: 0000000020000040
RBP: 00007f8ca8162610 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000000001
R13: 00007fffb8adb3b8 R14: 0000000000000001 R15: 0000000000000001


Memory state around the buggy address:
ffffc9000007ae80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
ffffc9000007af00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
>ffffc9000007af80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
^
ffffc9000007b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc9000007b080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
BUG: unable to handle page fault for address: ffffc9000007afff
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 100000067 P4D 100000067 PUD 10013a067 PMD 10013b067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 288 Comm: syz-executor160 Tainted: G B 5.10.225-syzkaller-00513-g8d23314f588a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:elf_validity_check kernel/module.c:3073 [inline]
RIP: 0010:load_module+0x3f4/0x5aa0 kernel/module.c:4008
Code: 48 ba 00 00 00 00 00 fc ff df 49 8b 06 48 89 44 24 48 4a 8d 5c 38 ff 48 89 d8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 77 26 00 00 <80> 3b 00 4c 8b 7c 24 70 0f 85 84 14 00 00 48 8d 5e 04 48 89 d8 48
RSP: 0018:ffffc90000b17b60 EFLAGS: 00010286
RAX: ffff888120f96201 RBX: ffffc9000007afff RCX: ffff888120f962c0
RDX: dffffc0000000000 RSI: ffffc9000007b3c2 RDI: 00000000ffffffff
RBP: ffffc90000b17d50 R08: ffffffff813e2a7b R09: 0000000000000003
R10: fffffbfff0e10c48 R11: dffffc0000000001 R12: ffffc90000b17dc0
R13: ffffc90000b17de8 R14: ffffc9000007b462 R15: ffffc9000007b000
FS: 000055556900d380(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc9000007afff CR3: 000000011aeea000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__do_sys_init_module kernel/module.c:4226 [inline]
__se_sys_init_module+0x238/0x2d0 kernel/module.c:4209
__x64_sys_init_module+0x76/0x80 kernel/module.c:4209
do_syscall_64+0x34/0x70
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f8ca80ef2a9
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:00007fffb8adb1e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000af
RAX: ffffffffffffffda RBX: 00007fffb8adb3c8 RCX: 00007f8ca80ef2a9
RDX: 0000000000000000 RSI: 0000000000000578 RDI: 0000000020000040
RBP: 00007f8ca8162610 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000000001
R13: 00007fffb8adb3b8 R14: 0000000000000001 R15: 0000000000000001
Modules linked in:
CR2: ffffc9000007afff
---[ end trace 4dd1025dfb771fa8 ]---
RIP: 0010:elf_validity_check kernel/module.c:3073 [inline]
RIP: 0010:load_module+0x3f4/0x5aa0 kernel/module.c:4008
Code: 48 ba 00 00 00 00 00 fc ff df 49 8b 06 48 89 44 24 48 4a 8d 5c 38 ff 48 89 d8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 77 26 00 00 <80> 3b 00 4c 8b 7c 24 70 0f 85 84 14 00 00 48 8d 5e 04 48 89 d8 48
RSP: 0018:ffffc90000b17b60 EFLAGS: 00010286
RAX: ffff888120f96201 RBX: ffffc9000007afff RCX: ffff888120f962c0
RDX: dffffc0000000000 RSI: ffffc9000007b3c2 RDI: 00000000ffffffff
RBP: ffffc90000b17d50 R08: ffffffff813e2a7b R09: 0000000000000003
R10: fffffbfff0e10c48 R11: dffffc0000000001 R12: ffffc90000b17dc0
R13: ffffc90000b17de8 R14: ffffc9000007b462 R15: ffffc9000007b000
FS: 000055556900d380(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc9000007afff CR3: 000000011aeea000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx
7: fc ff df
a: 49 8b 06 mov (%r14),%rax
d: 48 89 44 24 48 mov %rax,0x48(%rsp)
12: 4a 8d 5c 38 ff lea -0x1(%rax,%r15,1),%rbx
17: 48 89 d8 mov %rbx,%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 77 26 00 00 jne 0x26a1
* 2a: 80 3b 00 cmpb $0x0,(%rbx) <-- trapping instruction
2d: 4c 8b 7c 24 70 mov 0x70(%rsp),%r15
32: 0f 85 84 14 00 00 jne 0x14bc
38: 48 8d 5e 04 lea 0x4(%rsi),%rbx
3c: 48 89 d8 mov %rbx,%rax
3f: 48 rex.W


---
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
Reply all
Reply to author
Forward
0 new messages