Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5076786img; Wed, 27 Mar 2019 01:24:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHfF8Yw2vJCfBaoxmMcubykJmCKVgxrHc67ujlNJWByi6enV2/HAxwe+oNxVdlAzbU86Ef X-Received: by 2002:a62:ee13:: with SMTP id e19mr33995329pfi.224.1553675087311; Wed, 27 Mar 2019 01:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553675087; cv=none; d=google.com; s=arc-20160816; b=YzIWnBniWQG7rru7/w32nKkXnE01ln4/siKUwseh7VmME9/+pUSzTuCazWyN5jMU4v zgfuPv8xcI8+/zj4f/F3MmLhOFRA5YWZz0ktoYl2PhdR3gCslmhI1DNwQKvINHMXW1qL GBJfmEh8ZK9j3m4tR4bkgoIMNW3I2axyFYbqwZbFLSkYiNUzPfpMsvFh5dcgEYHSo/nG DF/1+IlTCAxbfwK+8h9HrPDZoFGlYbiFbp1hW1+ihGrnCdQI/JCHBPwNSVOdFRjMtSSg DN4SZoW8zC1kdEYeoEjmTCZ37SWKzqwZU8KP/UOMZ5/JrCqEnYuhB0SGELWChZA8+SQQ qD9w== 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 :in-reply-to:references:mime-version:dkim-signature; bh=zjedTqzCU/khXFD8XYPaJrkvkl9uSUvKbec7Mxv8XZk=; b=idsix8zGRRivDCNKS/63Pza3pln8QF3eovddrEX+QC2ciJy0XAOMScasTV5sMb3FTi 31i1VTi2r6T7hGBZKYex05ZS2MDaApdOq1cnMg7L1GTRLwZEFv/Jo7ywBanxqLZ+m3R5 xDtBCSiR4gg0i8u9mgen1ZJ7Lcvb2Wj156fbvNLyBAJKqQYkSkGZh8SvBUu7GigW8Q2E lIfndKu/lPCbCSmIeLHNjUug/JxqIduMSugcR0CJf60BhK3inzY52/VTs9Yo+BGhrCW9 S1Ap7rJKOKmadptNJPy1jJK6K0BjDniRpVFI4qbbtv4P7/4SItSPgCkhiWaammujHYAO lliQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=i2AiOdRq; 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 x5si18340742pln.220.2019.03.27.01.24.31; Wed, 27 Mar 2019 01:24:47 -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=i2AiOdRq; 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 S1732245AbfC0IWm (ORCPT + 99 others); Wed, 27 Mar 2019 04:22:42 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:36459 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725768AbfC0IWm (ORCPT ); Wed, 27 Mar 2019 04:22:42 -0400 Received: by mail-it1-f195.google.com with SMTP id h9so24706322itl.1 for ; Wed, 27 Mar 2019 01:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zjedTqzCU/khXFD8XYPaJrkvkl9uSUvKbec7Mxv8XZk=; b=i2AiOdRqNLUHSEbYAt5Xkw0hJJSo3uivppLILkcVZaEtwrRs7y+BdxjcSve8qQg7uP WWp1AoThuQWzoSjR3C3qnxx9BS2vEjS5iMIK1FA9UXdh8uZxSRsWFDEZxi0rh37ePauK 6F1eHxfBHBDvDo18QDcj6MQjQwffCMMnFZla62F8Tq/Vx9hLWWRsm2FteOzknOLWD9JE IzrY5mU4d3oeEnjI/FmpCdkdPtXRucHo7Dz/N3FXnQle51BQ+rY6O/s0i5pH/1lI8ofA iSgPwBxJtZ75ai53N6Hfd0SL8uGtl5giJNk5ziz5+6zNkI9B85VxlaFOGpSHwlZoeLWN aqIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zjedTqzCU/khXFD8XYPaJrkvkl9uSUvKbec7Mxv8XZk=; b=H8bbsbJeuSmSUI4bu+koEZMjKPsrPHLIhgoe4yOAvIAptjVKY76K32A4SwYTjxOliB kAmOD1/2mLBcyT4GP9ZI4jGVxqkZD5t/hZY4Ijh4zA6o2HU2nrk9uNC1nB6atyzwdYpM 7ri4vnNahVyUt40PN0H1aVtmdyQWTKdlkgYKd9G3n9McCNwM9ss9QmvNIhbofYIhsDgS VfMfJ7IkZlyF2i72kvQSVDi6spd88/KSGTBR20rvpSGJ2ZCnKY9zbBdk+Rgg/mzPg/Y1 tRPDv7MuFFjfpzNqqMWktlJ29cFxgebupv7H0iq8L1owmsHRUxEuaHsbVO9d5K7+C/yc vqsQ== X-Gm-Message-State: APjAAAXuJu+Uqkies6HFd4h9xAd8ZlZsAZzMtgtOc/fK1DAstqDjWC8F p4pKuKdbAaeXi5zOs+8H4KCpRT1rEsmJVgckpPG0Tw== X-Received: by 2002:a02:84ab:: with SMTP id f40mr23840821jai.72.1553674960905; Wed, 27 Mar 2019 01:22:40 -0700 (PDT) MIME-Version: 1.0 References: <0000000000004cd71f05850f17c2@google.com> In-Reply-To: <0000000000004cd71f05850f17c2@google.com> From: Dmitry Vyukov Date: Wed, 27 Mar 2019 09:22:29 +0100 Message-ID: Subject: Re: KASAN: use-after-free Read in __icmp_send To: syzbot , Eric Dumazet Cc: David Miller , Alexey Kuznetsov , LKML , netdev , syzkaller-bugs , Hideaki YOSHIFUJI 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 Wed, Mar 27, 2019 at 9:19 AM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit: 1d965c4d Merge branch 'Refactor-flower-classifier-to-remov.. > git tree: net-next > console output: https://syzkaller.appspot.com/x/log.txt?x=14ff71df200000 > kernel config: https://syzkaller.appspot.com/x/.config?x=f05902bca21d8935 > dashboard link: https://syzkaller.appspot.com/bug?extid=aa9105f99c12b6abfe27 > compiler: gcc (GCC) 9.0.0 20181231 (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+aa9105f99c12b6abfe27@syzkaller.appspotmail.com Eric, do you think this is also fixed by "tun: properly test for IFF_UP" as the bug in icmp6_send? > ================================================================== > BUG: KASAN: use-after-free in atomic_read > include/asm-generic/atomic-instrumented.h:26 [inline] > BUG: KASAN: use-after-free in queued_spin_trylock > include/asm-generic/qspinlock.h:69 [inline] > BUG: KASAN: use-after-free in do_raw_spin_trylock+0x6a/0x180 > kernel/locking/spinlock_debug.c:119 > Read of size 4 at addr ffff88808a28ccd4 by task syz-executor.0/17585 > > CPU: 0 PID: 17585 Comm: syz-executor.0 Not tainted 5.0.0+ #105 > 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+0x172/0x1f0 lib/dump_stack.c:113 > print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 > kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 > check_memory_region_inline mm/kasan/generic.c:185 [inline] > check_memory_region+0x123/0x190 mm/kasan/generic.c:191 > kasan_check_read+0x11/0x20 mm/kasan/common.c:102 > atomic_read include/asm-generic/atomic-instrumented.h:26 [inline] > queued_spin_trylock include/asm-generic/qspinlock.h:69 [inline] > do_raw_spin_trylock+0x6a/0x180 kernel/locking/spinlock_debug.c:119 > __raw_spin_trylock include/linux/spinlock_api_smp.h:89 [inline] > _raw_spin_trylock+0x1c/0x80 kernel/locking/spinlock.c:128 > spin_trylock include/linux/spinlock.h:339 [inline] > icmp_xmit_lock net/ipv4/icmp.c:219 [inline] > __icmp_send+0x553/0x1400 net/ipv4/icmp.c:666 > icmp_send include/net/icmp.h:47 [inline] > ipv4_link_failure+0x31/0x210 net/ipv4/route.c:1190 > dst_link_failure include/net/dst.h:416 [inline] > arp_error_report+0xd1/0x1c0 net/ipv4/arp.c:297 > neigh_invalidate+0x24b/0x570 net/core/neighbour.c:995 > neigh_timer_handler+0xc35/0xf30 net/core/neighbour.c:1081 > call_timer_fn+0x190/0x720 kernel/time/timer.c:1325 > expire_timers kernel/time/timer.c:1362 [inline] > __run_timers kernel/time/timer.c:1681 [inline] > __run_timers kernel/time/timer.c:1649 [inline] > run_timer_softirq+0x652/0x1700 kernel/time/timer.c:1694 > __do_softirq+0x266/0x95a kernel/softirq.c:293 > invoke_softirq kernel/softirq.c:374 [inline] > irq_exit+0x180/0x1d0 kernel/softirq.c:414 > exiting_irq arch/x86/include/asm/apic.h:536 [inline] > smp_apic_timer_interrupt+0x14a/0x570 arch/x86/kernel/apic/apic.c:1062 > apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807 > > RIP: 0010:filename_mountpoint+0x25d/0x3c0 fs/namei.c:2722 > Code: 14 02 4c 89 e0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 1c 01 00 00 > 45 8b 24 24 31 ff 44 89 e6 e8 58 ea ba ff 45 85 e4 74 62 ce e8 ba ff > e8 49 2a fe ff 4c 89 f7 e8 81 f2 ff ff e8 bc e8 ba > RSP: 0018:ffff8880a857fc30 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 > RAX: dffffc0000000000 RBX: 1ffff110150aff88 RCX: ffffffff81b57ad4 > RDX: 1ffff1100bd8e54c RSI: ffffffff81b57ae2 RDI: ffff88805ec72a60 > RBP: ffff8880a857fdc8 R08: ffff88805ec72300 R09: 0000000000000001 > R10: 000000000000001c R11: ffff8880ae82de3b R12: 0000000000000000 > R13: 0000000000000000 R14: ffff888097790e00 R15: ffff8880a857fe68 > user_path_mountpoint_at+0x3a/0x50 fs/namei.c:2745 > ksys_umount+0x167/0xf00 fs/namespace.c:1687 > __do_sys_umount fs/namespace.c:1713 [inline] > __se_sys_umount fs/namespace.c:1711 [inline] > __x64_sys_umount+0x54/0x80 fs/namespace.c:1711 > do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > RIP: 0033:0x45ac57 > Code: 44 00 00 b8 08 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 4d 8e fb ff c3 > 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff > ff 0f 83 2d 8e fb ff c3 66 2e 0f 1f 84 00 00 00 00 > RSP: 002b:00007ffe6359ff08 EFLAGS: 00000202 ORIG_RAX: 00000000000000a6 > RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000045ac57 > RDX: 0000000000402ea0 RSI: 0000000000000002 RDI: 00007ffe6359ffb0 > RBP: 00000000000019e0 R08: 0000000000000000 R09: 000000000000000d > R10: 0000000000000006 R11: 0000000000000202 R12: 00007ffe635a1040 > R13: 0000000000bfa940 R14: 0000000000000000 R15: 00007ffe635a1040 > > Allocated by task 12478: > save_stack+0x45/0xd0 mm/kasan/common.c:75 > set_track mm/kasan/common.c:87 [inline] > __kasan_kmalloc mm/kasan/common.c:497 [inline] > __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 > kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:505 > slab_post_alloc_hook mm/slab.h:436 [inline] > slab_alloc mm/slab.c:3392 [inline] > kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3554 > getname_flags fs/namei.c:138 [inline] > getname_flags+0xd6/0x5b0 fs/namei.c:128 > getname+0x1a/0x20 fs/namei.c:209 > do_sys_open+0x2c9/0x5d0 fs/open.c:1057 > __do_sys_open fs/open.c:1081 [inline] > __se_sys_open fs/open.c:1076 [inline] > __x64_sys_open+0x7e/0xc0 fs/open.c:1076 > do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > > Freed by task 12478: > save_stack+0x45/0xd0 mm/kasan/common.c:75 > set_track mm/kasan/common.c:87 [inline] > __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 > kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 > __cache_free mm/slab.c:3498 [inline] > kmem_cache_free+0x86/0x260 mm/slab.c:3764 > putname+0xef/0x130 fs/namei.c:259 > do_sys_open+0x318/0x5d0 fs/open.c:1072 > __do_sys_open fs/open.c:1081 [inline] > __se_sys_open fs/open.c:1076 [inline] > __x64_sys_open+0x7e/0xc0 fs/open.c:1076 > do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > > The buggy address belongs to the object at ffff88808a28c780 > which belongs to the cache names_cache of size 4096 > The buggy address is located 1364 bytes inside of > 4096-byte region [ffff88808a28c780, ffff88808a28d780) > The buggy address belongs to the page: > page:ffffea000228a300 count:1 mapcount:0 mapping:ffff88812c2d8dc0 index:0x0 > compound_mapcount: 0 > flags: 0x1fffc0000010200(slab|head) > raw: 01fffc0000010200 ffffea00025c8908 ffffea0001840a08 ffff88812c2d8dc0 > raw: 0000000000000000 ffff88808a28c780 0000000100000001 0000000000000000 > page dumped because: kasan: bad access detected > > Memory state around the buggy address: > ffff88808a28cb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ffff88808a28cc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > > ffff88808a28cc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ^ > ffff88808a28cd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ffff88808a28cd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ================================================================== > > > --- > 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#status 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/0000000000004cd71f05850f17c2%40google.com. > For more options, visit https://groups.google.com/d/optout.