Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp855217imm; Fri, 28 Sep 2018 07:57:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV6142Zct1UxN2GGF6uVxUWLM2S5evjgoqyh/FMhbNdc5cuE/59wR/K83OOpF+m9G21f6F9Bb X-Received: by 2002:a63:db04:: with SMTP id e4-v6mr6299020pgg.280.1538146645215; Fri, 28 Sep 2018 07:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538146645; cv=none; d=google.com; s=arc-20160816; b=LCxYnf8HXYC2ayS6N8fBC0q2GBrNAY2b2wSYdfuldW/PlTdI4bCRVGloD7FkM4XPVa xpj8cAlthW0MX/2+6l+jE7OW+2afBOhkZzVCM9Tss1ZtHxxi/tamNsB9ts9RkiLatTCE 6V3XApnLVgLtUGMNBqcuNl6URTjb3CzJq8pUy4Bty1iv1SkB6mM9ySGywFsOLY3l4L2m Gf1mskgv45p4AKsfQhL2ojSoSYXZibwz3hZe4Si84KLD6sL7Xk8YTsHzJj6rxKdWetiA 4WEKtHJVbB/3oQV3ogdNdlvBydb0W8O+MOE6CcGSj1y4q9LVby/l507QdkVQWzHl3keS wLtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=yBJVWrd1B6/Qmjd5s2uvQeofnVOBerar1G5f0Zk9ckE=; b=OoKo+c1R+b0ScYSmHVDNrsjYftudWfy/w0JwreFU9waGt+tOKg70g4XWyAyD2QyKwE Af0tPgWpys+6kZf4DajoF2EDm3Qk8hRzZ51BXw0NbQ+sSWs0B6EfMcD/Kfu+qc9WzKHY qfotcAowm/CuuC/43L8hFl1u6bPXW8/ifidR+MYBQ+JEMfZfH7oo//Pvt/AXtCEEf8My F6oAD1GQQa+wNOUwImGWlwmEmHvam7OWvWZyS0c+UU4Zabq3t52yk285COiaaJ8dM9D4 H5IgF21vxlXb10K4dzOp0GlLLqeZZ9UOYIE6NRz1cK1PwFvaCUC8QZQFPFQztatOkQZc LaUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oBIM3rQC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9-v6si4842452pgi.553.2018.09.28.07.57.09; Fri, 28 Sep 2018 07:57:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oBIM3rQC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728889AbeI1VTq (ORCPT + 99 others); Fri, 28 Sep 2018 17:19:46 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:38053 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727349AbeI1VTp (ORCPT ); Fri, 28 Sep 2018 17:19:45 -0400 Received: by mail-it1-f195.google.com with SMTP id p129-v6so2896622ite.3 for ; Fri, 28 Sep 2018 07:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yBJVWrd1B6/Qmjd5s2uvQeofnVOBerar1G5f0Zk9ckE=; b=oBIM3rQCHN2xC7AjkOI80YuzcCu7QlAhSVOBNdHa2mnaTcEBFf0tRHjCrZHU5xlmel Pe7BzPs2D4i/oSso4y0mmX1t3/igf9PVByx2fe8vVH7fo3xZr8gjA31E1f+0h7W14IR+ x7hRs0tv7TAsKShwkpp4hiL0fYEys9ziUZdCpkGgWm/JHrWZ3aEOxMUhqmU5gFIRlQc+ bJHlCNwXPfzB4fYUmT2u//7JFvzNDjLNtB90qAkr/oD6A4W4bKZ+uz5JlQ/lQHC1bvXc COQIV3DonwhuwNAICAdULJ2KAArQkRDjPEiSDMDAGkqtVYW+xQ1RDWLTk1TCm93h37c8 UyXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yBJVWrd1B6/Qmjd5s2uvQeofnVOBerar1G5f0Zk9ckE=; b=dOAf59wEnm0JzkYnaT+qrAwq0OnKOuiMXidQLFYYbfMOUMcEcRQmy8gCJgQWDab0z0 QzJ//BkAiiH/uTLCmSw/msOhs1zJPaJqOPX6wHz6H2gFQa6bmsW53cYBBhaiZEGnbS7n wiHUXNnT0T+h0fF3Jkio91Zg93nIoctR09ZhclQJfAW8+UunwGVHWAHpLFkUJLI5288Y tLHrwESY7uk/WOraYenqC+f/ags0oVdt0mcieOuiAPqAG8mim/t+Tc/O7V98WBWqe7U/ hOmorPWTPV4CVRfaCeycEWad8SPeCGsOBUTXm4QYJ/fxMFTcT4Ut+OGGl+IPuL7Z0oxq H9wA== X-Gm-Message-State: ABuFfoixVRxMTbhsdjqJOmxI8IDD42gYvaRu3rlQ+zeASyuf1jzQm2a9 vgp4xsb/dnlB+ZiOlv4r4KHA0fdxonEjDFlQTtbqKg== X-Received: by 2002:a24:c0c5:: with SMTP id u188-v6mr1892280itf.57.1538146535055; Fri, 28 Sep 2018 07:55:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:ab8c:0:0:0:0:0 with HTTP; Fri, 28 Sep 2018 07:55:14 -0700 (PDT) In-Reply-To: <0000000000003852440576ef80b2@google.com> References: <0000000000003852440576ef80b2@google.com> From: Dmitry Vyukov Date: Fri, 28 Sep 2018 16:55:14 +0200 Message-ID: Subject: Re: KASAN: slab-out-of-bounds Read in string (2) To: syzbot , Miklos Szeredi , linux-unionfs@vger.kernel.org Cc: LKML , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , syzkaller-bugs Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 28, 2018 at 4:45 PM, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit: c127e59bee3e Merge tag 'for_v4.19-rc6' of git://git.kernel.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=13b2f32a400000 > kernel config: https://syzkaller.appspot.com/x/.config?x=dfb440e26f0a6f6f > dashboard link: https://syzkaller.appspot.com/bug?extid=376cea2b0ef340db3dd4 > compiler: gcc (GCC) 8.0.1 20180413 (experimental) > > Unfortunately, I don't have any reproducer for this crash yet. > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > Reported-by: syzbot+376cea2b0ef340db3dd4@syzkaller.appspotmail.com I guess this is overlayfs rather than printk. +overlayfs maintainers In future syzbot will avoid attributing crashes to printk, because I think it's not the first time crashes are mis-attributed to printk: https://github.com/google/syzkaller/commit/41e4b32952f4590341ae872db0abf819b4004713 > RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000140 > RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0e714a76d4 > R13: 00000000004c32cb R14: 00000000004d4ef0 R15: 0000000000000004 > ================================================================== > BUG: KASAN: slab-out-of-bounds in string+0x298/0x2d0 lib/vsprintf.c:604 > Read of size 1 at addr ffff8801c36c66ba by task syz-executor2/27811 > > CPU: 0 PID: 27811 Comm: syz-executor2 Not tainted 4.19.0-rc5+ #36 > 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+0x1c4/0x2b4 lib/dump_stack.c:113 > print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 > kasan_report_error mm/kasan/report.c:354 [inline] > kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 > __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430 > string+0x298/0x2d0 lib/vsprintf.c:604 > vsnprintf+0x48e/0x1b60 lib/vsprintf.c:2293 > vscnprintf+0x2d/0x80 lib/vsprintf.c:2396 > vprintk_store+0x43/0x510 kernel/printk/printk.c:1847 > vprintk_emit+0x1c1/0x930 kernel/printk/printk.c:1905 > vprintk_default+0x28/0x30 kernel/printk/printk.c:1963 > vprintk_func+0x7e/0x181 kernel/printk/printk_safe.c:398 > printk+0xa7/0xcf kernel/printk/printk.c:1996 > ovl_lookup_index.cold.15+0xe8/0x1f8 fs/overlayfs/namei.c:689 > ovl_lookup+0x9f2/0x29c0 fs/overlayfs/namei.c:1022 > __lookup_hash+0x12e/0x190 fs/namei.c:1546 > do_rmdir+0x3b3/0x630 fs/namei.c:3930 > __do_sys_rmdir fs/namei.c:3959 [inline] > __se_sys_rmdir fs/namei.c:3957 [inline] > __x64_sys_rmdir+0x36/0x40 fs/namei.c:3957 > do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > RIP: 0033:0x457579 > Code: 1d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 > 0f 83 eb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 > RSP: 002b:00007f0e714a6c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000054 > RAX: ffffffffffffffda RBX: 00007f0e714a6c90 RCX: 0000000000457579 > RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000140 > RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0e714a76d4 > R13: 00000000004c32cb R14: 00000000004d4ef0 R15: 0000000000000004 > > Allocated by task 27811: > save_stack+0x43/0xd0 mm/kasan/kasan.c:448 > set_track mm/kasan/kasan.c:460 [inline] > kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 > __do_kmalloc mm/slab.c:3718 [inline] > __kmalloc+0x14e/0x760 mm/slab.c:3727 > kmalloc_array include/linux/slab.h:635 [inline] > kcalloc include/linux/slab.h:646 [inline] > ovl_get_index_name_fh+0x57/0x180 fs/overlayfs/namei.c:596 > ovl_get_index_name+0x5c/0x80 fs/overlayfs/namei.c:631 > ovl_lookup_index+0xe4/0x700 fs/overlayfs/namei.c:678 > ovl_lookup+0x9f2/0x29c0 fs/overlayfs/namei.c:1022 > __lookup_hash+0x12e/0x190 fs/namei.c:1546 > do_rmdir+0x3b3/0x630 fs/namei.c:3930 > __do_sys_rmdir fs/namei.c:3959 [inline] > __se_sys_rmdir fs/namei.c:3957 [inline] > __x64_sys_rmdir+0x36/0x40 fs/namei.c:3957 > do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > > Freed by task 5441: > save_stack+0x43/0xd0 mm/kasan/kasan.c:448 > set_track mm/kasan/kasan.c:460 [inline] > __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 > kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 > __cache_free mm/slab.c:3498 [inline] > kfree+0xcf/0x230 mm/slab.c:3813 > __vunmap+0x335/0x460 mm/vmalloc.c:1532 > vfree+0x68/0x100 mm/vmalloc.c:1593 > copy_entries_to_user net/ipv4/netfilter/ip_tables.c:870 [inline] > get_entries net/ipv4/netfilter/ip_tables.c:1027 [inline] > do_ipt_get_ctl+0x9eb/0xbc0 net/ipv4/netfilter/ip_tables.c:1703 > nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] > nf_getsockopt+0x80/0xe0 net/netfilter/nf_sockopt.c:122 > ip_getsockopt+0x1af/0x240 net/ipv4/ip_sockglue.c:1577 > tcp_getsockopt+0x93/0xe0 net/ipv4/tcp.c:3583 > sock_common_getsockopt+0x9a/0xe0 net/core/sock.c:2997 > __sys_getsockopt+0x1ad/0x390 net/socket.c:1939 > __do_sys_getsockopt net/socket.c:1950 [inline] > __se_sys_getsockopt net/socket.c:1947 [inline] > __x64_sys_getsockopt+0xbe/0x150 net/socket.c:1947 > do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > > The buggy address belongs to the object at ffff8801c36c6680 > which belongs to the cache kmalloc-64 of size 64 > The buggy address is located 58 bytes inside of > 64-byte region [ffff8801c36c6680, ffff8801c36c66c0) > The buggy address belongs to the page: > page:ffffea00070db180 count:1 mapcount:0 mapping:ffff8801da800340 > index:0xffff8801c36c6380 > flags: 0x2fffc0000000100(slab) > raw: 02fffc0000000100 ffffea0006d16508 ffffea000638a588 ffff8801da800340 > raw: ffff8801c36c6380 ffff8801c36c6000 000000010000001b 0000000000000000 > page dumped because: kasan: bad access detected > > Memory state around the buggy address: > ffff8801c36c6580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc > ffff8801c36c6600: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >> >> ffff8801c36c6680: 00 00 00 00 00 00 00 02 fc fc fc fc fc fc fc fc > > ^ > ffff8801c36c6700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc > ffff8801c36c6780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc > ================================================================== > > > --- > This bug 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 syzkaller@googlegroups.com. > > syzbot will keep track of this bug report. See: > https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with > syzbot. > > -- > You received this message because you are subscribed to the Google Groups > "syzkaller-bugs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to syzkaller-bugs+unsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/syzkaller-bugs/0000000000003852440576ef80b2%40google.com. > For more options, visit https://groups.google.com/d/optout.