<div dir="ltr">FYI Gmail has a setting of making Replay All the default button.</div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 14, 2020 at 9:39 AM Fox Chen <<a href="mailto:foxhlchen@gmail.com">foxhlchen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi, <div><br></div><div>I found this bug was caused by either uid/gid info in superblocks or id_index_table is corrupted. The uid/gid index is larger than the size of msblk->id_table.<br></div><div><br></div><div>Should I add a sanity check to squashfs_get_id?? </div><div><br></div><div><br></div><div>The complete solution is to record the size of msblk->id_table in msblk and check uid/gid index each time in squashfs_get_id. However, this requires a change to msblk struct.</div><div><br></div><div>A simple solution is to calculate the max available room for uid/gid table by doing msblk->xattr_table - msblk->id_table[0] and check if index is larger than this. While this provides some sort of check, it is imperfect because id_table can be smaller than that. </div><div><br></div><div>Both of them work out for this bug.</div><div><br></div><div><br></div><div>thanks,</div><div>fox</div><div><br></div><div class="gmail_quote"><div dir="auto" class="gmail_attr">On Friday, September 25, 2020 at 10:48:18 PM UTC+8 syzbot wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,
<br>
<br>syzbot found the following issue on:
<br>
<br>HEAD commit:    171d4ff7 Merge tag 'mmc-v5.9-rc4-2' of git://git.kernel.or..
<br>git tree:       upstream
<br>console output: <a href="https://syzkaller.appspot.com/x/log.txt?x=1597ead3900000" rel="nofollow" target="_blank">https://syzkaller.appspot.com/x/log.txt?x=1597ead3900000</a>
<br>kernel config:  <a href="https://syzkaller.appspot.com/x/.config?x=af502ec9a451c9fc" rel="nofollow" target="_blank">https://syzkaller.appspot.com/x/.config?x=af502ec9a451c9fc</a>
<br>dashboard link: <a href="https://syzkaller.appspot.com/bug?extid=8e28bba73ed1772a6802" rel="nofollow" target="_blank">https://syzkaller.appspot.com/bug?extid=8e28bba73ed1772a6802</a>
<br>compiler:       clang version 10.0.0 (<a href="https://github.com/llvm/llvm-project/" rel="nofollow" target="_blank">https://github.com/llvm/llvm-project/</a> c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
<br>syz repro:      <a href="https://syzkaller.appspot.com/x/repro.syz?x=172ff481900000" rel="nofollow" target="_blank">https://syzkaller.appspot.com/x/repro.syz?x=172ff481900000</a>
<br>C reproducer:   <a href="https://syzkaller.appspot.com/x/repro.c?x=17c3e6c5900000" rel="nofollow" target="_blank">https://syzkaller.appspot.com/x/repro.c?x=17c3e6c5900000</a>
<br>
<br>IMPORTANT: if you fix the issue, please add the following tag to the commit:
<br>Reported-by: <a rel="nofollow">syzbot+8e28bb...@syzkaller.appspotmail.com</a>
<br>
<br>==================================================================
<br>BUG: KASAN: slab-out-of-bounds in squashfs_get_id+0xb9/0x1c0 fs/squashfs/id.c:38
<br>Read of size 8 at addr ffff8880a9684b98 by task syz-executor329/6836
<br>
<br>CPU: 1 PID: 6836 Comm: syz-executor329 Not tainted 5.9.0-rc6-syzkaller #0
<br>Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
<br>Call Trace:
<br> __dump_stack lib/dump_stack.c:77 [inline]
<br> dump_stack+0x1d6/0x29e lib/dump_stack.c:118
<br> print_address_description+0x66/0x620 mm/kasan/report.c:383
<br> __kasan_report mm/kasan/report.c:513 [inline]
<br> kasan_report+0x132/0x1d0 mm/kasan/report.c:530
<br> squashfs_get_id+0xb9/0x1c0 fs/squashfs/id.c:38
<br> squashfs_new_inode fs/squashfs/inode.c:51 [inline]
<br> squashfs_read_inode+0x155/0x2170 fs/squashfs/inode.c:120
<br> squashfs_fill_super+0x1478/0x1790 fs/squashfs/super.c:310
<br> get_tree_bdev+0x3e9/0x5f0 fs/super.c:1342
<br> vfs_get_tree+0x88/0x270 fs/super.c:1547
<br> do_new_mount fs/namespace.c:2875 [inline]
<br> path_mount+0x179d/0x29e0 fs/namespace.c:3192
<br> do_mount fs/namespace.c:3205 [inline]
<br> __do_sys_mount fs/namespace.c:3413 [inline]
<br> __se_sys_mount+0x126/0x180 fs/namespace.c:3390
<br> do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
<br> entry_SYSCALL_64_after_hwframe+0x44/0xa9
<br>RIP: 0033:0x446d1a
<br>Code: b8 08 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 fd ad fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 da ad fb ff c3 66 0f 1f 84 00 00 00 00 00
<br>RSP: 002b:00007ffd7dd4f8b8 EFLAGS: 00000293 ORIG_RAX: 00000000000000a5
<br>RAX: ffffffffffffffda RBX: 00007ffd7dd4f910 RCX: 0000000000446d1a
<br>RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffd7dd4f8d0
<br>RBP: 00007ffd7dd4f8d0 R08: 00007ffd7dd4f910 R09: 00007ffd00000015
<br>R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000001
<br>R13: 0000000000000004 R14: 0000000000000003 R15: 0000000000000003
<br>
<br>Allocated by task 3913:
<br> kasan_save_stack mm/kasan/common.c:48 [inline]
<br> kasan_set_track mm/kasan/common.c:56 [inline]
<br> __kasan_kmalloc+0x100/0x130 mm/kasan/common.c:461
<br> kmalloc_node include/linux/slab.h:577 [inline]
<br> __vmalloc_area_node mm/vmalloc.c:2429 [inline]
<br> __vmalloc_node_range+0x2c7/0x870 mm/vmalloc.c:2511
<br> module_alloc+0x7e/0x90 arch/x86/kernel/module.c:75
<br> bpf_jit_binary_alloc+0x123/0x230 kernel/bpf/core.c:871
<br> bpf_int_jit_compile+0x7995/0x8920 arch/x86/net/bpf_jit_comp.c:1911
<br> bpf_prog_select_runtime+0x76d/0xa60 kernel/bpf/core.c:1807
<br> bpf_migrate_filter net/core/filter.c:1290 [inline]
<br> bpf_prepare_filter+0xec2/0x1140 net/core/filter.c:1338
<br> bpf_prog_create_from_user+0x2ad/0x3e0 net/core/filter.c:1432
<br> seccomp_prepare_filter kernel/seccomp.c:567 [inline]
<br> seccomp_prepare_user_filter kernel/seccomp.c:604 [inline]
<br> seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
<br> do_seccomp+0x852/0x20b0 kernel/seccomp.c:1661
<br> do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
<br> entry_SYSCALL_64_after_hwframe+0x44/0xa9
<br>
<br>The buggy address belongs to the object at ffff8880a9684b80
<br> which belongs to the cache kmalloc-32 of size 32
<br>The buggy address is located 24 bytes inside of
<br> 32-byte region [ffff8880a9684b80, ffff8880a9684ba0)
<br>The buggy address belongs to the page:
<br>page:00000000f697ca3d refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880a9684fc1 pfn:0xa9684
<br>flags: 0xfffe0000000200(slab)
<br>raw: 00fffe0000000200 ffffea0002a5d5c8 ffffea0002a98588 ffff8880aa440100
<br>raw: ffff8880a9684fc1 ffff8880a9684000 000000010000003f 0000000000000000
<br>page dumped because: kasan: bad access detected
<br>
<br>Memory state around the buggy address:
<br> ffff8880a9684a80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
<br> ffff8880a9684b00: 00 fc fc fc fc fc fc fc fa fb fb fb fc fc fc fc
<br>>ffff8880a9684b80: 00 fc fc fc fc fc fc fc fa fb fb fb fc fc fc fc
<br>                            ^
<br> ffff8880a9684c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
<br> ffff8880a9684c80: 00 00 01 fc fc fc fc fc fa fb fb fb fc fc fc fc
<br>==================================================================
<br>
<br>
<br>---
<br>This report is generated by a bot. It may contain errors.
<br>See <a href="https://goo.gl/tpsmEJ" rel="nofollow" target="_blank">https://goo.gl/tpsmEJ</a> for more information about syzbot.
<br>syzbot engineers can be reached at <a rel="nofollow">syzk...@googlegroups.com</a>.
<br>
<br>syzbot will keep track of this issue. See:
<br><a href="https://goo.gl/tpsmEJ#status" rel="nofollow" target="_blank">https://goo.gl/tpsmEJ#status</a> for how to communicate with syzbot.
<br>syzbot can test patches for this issue, for details see:
<br><a href="https://goo.gl/tpsmEJ#testing-patches" rel="nofollow" target="_blank">https://goo.gl/tpsmEJ#testing-patches</a>
<br></blockquote></div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:syzkaller-bugs+unsubscribe@googlegroups.com" target="_blank">syzkaller-bugs+unsubscribe@googlegroups.com</a>.<br>
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/syzkaller-bugs/300c32a1-a0de-4f05-b467-0822b3d21733n%40googlegroups.com?utm_medium=email&utm_source=footer" target="_blank">https://groups.google.com/d/msgid/syzkaller-bugs/300c32a1-a0de-4f05-b467-0822b3d21733n%40googlegroups.com</a>.<br>
</blockquote></div>