Received: by 10.223.176.46 with SMTP id f43csp4552071wra; Tue, 23 Jan 2018 10:52:19 -0800 (PST) X-Google-Smtp-Source: AH8x224p0tzqXlnD9dEdRrJ2fbeUKvFILbu2o99XT/CQc3WKNK/yI7tHrxk0g/uUcRn+RwjmRtQ3 X-Received: by 10.36.84.205 with SMTP id t196mr5224300ita.128.1516733539020; Tue, 23 Jan 2018 10:52:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516733538; cv=none; d=google.com; s=arc-20160816; b=Fr5oemS9AtU9a70KpjgRGMLahxYBFF7BfXARjTflX1cogSy0VoDMxmc4MsGoVNovxA s1v86vN+xhNXNA+HspNPzczmviKguXEVqShPJtwqo1yvIwi6vAb+sX8apmCJhP4ezsyH ONpPHtxwEX+VjTRlZwT3V44FQumIeYDdIiZSmdOP4VG7fIN2JhDT8BQpLWcKN1Jwc40r FHIUD1ou2AJEWJR7xS2PKR9MR0CJejE/KfZSK+fhu1JKCXZiuB6dZHAAxkL7vrxnU7Cr ufDbfCYjOueaXCDfI2ZpP65xVa1Wwq1rlbacdmwlb5LQb5XFq02mDE3a5lErQ1C013gj 5sBw== 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 :arc-authentication-results; bh=Y5naulqok8bimU9WXZAaSi/rVvwltKFdVw0Gj7ccZaQ=; b=1DhCO0AD2aBP7k7B+2FEg6POQvSoOmNilcSYL4UXPhreColpvLC7kVr/8CI+1DAc5m mLLZhW4jzypKcPrGKNJqvaq2UuXZdzRLI1zcywKcqx1LigdFIKmS3mg+U2ZiQPKn3JFV u9l2wXJRGYR/GGdbV3Y+QiLKNqE9MhDMRYtA7vDuYDFJoXK+2VMYsVnQ/ZGqe+8SEDDc 62q0QkljwK+kYpzS9ztwLUINdbk67Fjh4+LMWRRv7DWieJpJMRbzkzIuL/eMaXomuyFZ y0GjEeyTLFDX6IgFMEJA0zsFE+w5KssmH38eFY18nu4o/R5GO4TvD0a4qRZ4LcVAsck7 oDhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U3pFr3Uy; 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=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 11si9359675iti.19.2018.01.23.10.51.43; Tue, 23 Jan 2018 10:52:18 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=U3pFr3Uy; 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=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752491AbeAWSuo (ORCPT + 99 others); Tue, 23 Jan 2018 13:50:44 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:36034 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752338AbeAWSum (ORCPT ); Tue, 23 Jan 2018 13:50:42 -0500 Received: by mail-it0-f65.google.com with SMTP id p124so2183584ite.1; Tue, 23 Jan 2018 10:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Y5naulqok8bimU9WXZAaSi/rVvwltKFdVw0Gj7ccZaQ=; b=U3pFr3UydCmzJybjGAMbCvVbIrV3OePXgra+eIrA79tVwzqJaL2EzOXjnWYFe6HeGo Oo4+sTvUUhvucuU9K2D1lh1HdnZVkWBEH4l3ma4k+RdUIGujYRKVQfzsARqpwa7VcTBl 8i5/7rDPCdD5EkyufyL7RepxyCwUueylhwMaNMz5zg2a/peoRoIGvJtSxqMWUsu86jk1 45sOQme95OzDqtRIxe4tY6usD0yCvRBuzn142S0x/E5fLv93fqtxOgtEvaIpkI50MigG SCAQxU/ZKvNb9YaEc4+/f2PvHYWzOvd8QlASZyYEC1BMr1q7Qgyi4L7QVglgs/95o0PN Vdbg== 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=Y5naulqok8bimU9WXZAaSi/rVvwltKFdVw0Gj7ccZaQ=; b=LGvM+C4rxj5jGYcvbJHPf1TR5Ih16bdqE/zWfsUmUInkzdwsxykmjfiqJkLz9e+5pu FlhBxP57xdifV4mK4Gh6EINegziYTzRRaklpThAbjQHyBF7CtEkdE+oqUHB5+EshPypx ZeDqLp/VmMx7J4p7MoMvyNJWdou993liCdXPOXBf46wlDzW0FAM7CGD+UNAsjDTf9OL7 W5XFC+3xtBZyyQGIJVkTOJoDnQ2yo61MndTzgy+sY3mOJqazv5PuzpJNW+VIpBIoel0Q 7Juh2ZR53gLvT5K/HbZyIW/yUu48cjznQ5nSCNIxk8lXw6fetJtGKg0lWVfaze8BwfH6 S7hQ== X-Gm-Message-State: AKwxyteruBd3ltnY4DqUAGd+UCUDPatx5Wr7GcsvaQO9C4/O1/J2y6Xf wAoyxboG1det8taskviXwZG47yqgVAzK39AaqRUYxHHy X-Received: by 10.36.254.8 with SMTP id w8mr5206601ith.51.1516733441183; Tue, 23 Jan 2018 10:50:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.214.151 with HTTP; Tue, 23 Jan 2018 10:50:00 -0800 (PST) In-Reply-To: References: <001a113e9f281d2cc3056362d99a@google.com> <7d3e467c-543c-7076-e900-25028a2c54b5@gmail.com> From: William Tu Date: Tue, 23 Jan 2018 10:50:00 -0800 Message-ID: Subject: Re: KASAN: slab-out-of-bounds Read in erspan_xmit To: David Ahern Cc: syzbot , David Miller , Alexey Kuznetsov , linux-kernel@vger.kernel.org, Linux Kernel Network Developers , syzkaller-bugs@googlegroups.com, 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 Hi, I'm new to kasan and trying to follow this instruction to reproduce the issue: https://github.com/google/syzkaller/blob/master/docs/executing_syzkaller_programs.md After re-compile my kernel with KASAN related config enable, I run $ ./syz-execprog -cover=0 -repeat=0 -procs=16 program I wonder does the "program" mean the repro.c.txt? or I should compile it to binary? # gcc -o program repro.c.txt # ./syz-execprog myprogram 2018/01/23 10:45:19 parsed 0 programs And how to use the "repro.syz.txt"? It seems to have some command like "syz_emit_ethernet" to generate packet. but I have no clue where to run it. Maybe I'm still missing something? Thanks a lot William On Mon, Jan 22, 2018 at 2:57 PM, William Tu wrote: > On Mon, Jan 22, 2018 at 2:45 PM, David Ahern wrote: >> [ cc William Tu ] >> >> On 1/22/18 12:58 PM, syzbot wrote: >>> Hello, >>> >>> syzbot hit the following crash on net-next commit >>> 9d6474e458b13a94a0d5b141f2b8f38adf1991ae (Mon Jan 22 02:55:38 2018 +0000) >>> tun: add missing rcu annotation >>> >>> So far this crash happened 5 times on net-next. >>> C reproducer is attached. >>> syzkaller reproducer is attached. >>> Raw console output is attached. >>> compiler: gcc (GCC) 7.1.1 20170620 >>> .config is attached. >>> >>> IMPORTANT: if you fix the bug, please add the following tag to the commit: >>> Reported-by: syzbot+9723f2d288e49b492cf0@syzkaller.appspotmail.com >>> It will help syzbot understand when the bug is fixed. See footer for >>> details. >>> If you forward the report, please keep this part and the footer. >>> >>> ================================================================== >>> BUG: KASAN: slab-out-of-bounds in erspan_xmit+0x22d4/0x2430 >>> net/ipv4/ip_gre.c:735 >>> Read of size 2 at addr ffff8801c50bb08b by task syzkaller525754/3647 >>> >>> CPU: 0 PID: 3647 Comm: syzkaller525754 Not tainted 4.15.0-rc8+ #203 >>> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS >>> Google 01/01/2011 >>> Call Trace: >>> __dump_stack lib/dump_stack.c:17 [inline] >>> dump_stack+0x194/0x257 lib/dump_stack.c:53 >>> print_address_description+0x73/0x250 mm/kasan/report.c:252 >>> kasan_report_error mm/kasan/report.c:351 [inline] >>> kasan_report+0x25b/0x340 mm/kasan/report.c:409 >>> __asan_report_load_n_noabort+0xf/0x20 mm/kasan/report.c:440 >>> erspan_xmit+0x22d4/0x2430 net/ipv4/ip_gre.c:735 >>> __netdev_start_xmit include/linux/netdevice.h:4053 [inline] >>> netdev_start_xmit include/linux/netdevice.h:4062 [inline] >>> packet_direct_xmit+0x3ad/0x790 net/packet/af_packet.c:267 >>> packet_snd net/packet/af_packet.c:2944 [inline] >>> packet_sendmsg+0x3aed/0x60b0 net/packet/af_packet.c:2969 >>> sock_sendmsg_nosec net/socket.c:630 [inline] >>> sock_sendmsg+0xca/0x110 net/socket.c:640 >>> SYSC_sendto+0x361/0x5c0 net/socket.c:1721 >>> SyS_sendto+0x40/0x50 net/socket.c:1689 >>> entry_SYSCALL_64_fastpath+0x29/0xa0 >>> RIP: 0033:0x445649 >>> RSP: 002b:00007ffe82dde5b8 EFLAGS: 00000217 ORIG_RAX: 000000000000002c >>> RAX: ffffffffffffffda RBX: ffffffffffffffff RCX: 0000000000445649 >>> RDX: 0000000000000000 RSI: 0000000020003fd9 RDI: 0000000000000004 >>> RBP: 00000000004a78c5 R08: 0000000020008000 R09: 000000000000001c >>> R10: 0000000000000000 R11: 0000000000000217 R12: 0000000000402720 >>> R13: 00000000004027b0 R14: 0000000000000000 R15: 0000000000000000 >>> >>> Allocated by task 3221: >>> save_stack+0x43/0xd0 mm/kasan/kasan.c:447 >>> set_track mm/kasan/kasan.c:459 [inline] >>> kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 >>> kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 >>> kmem_cache_alloc+0x12e/0x760 mm/slab.c:3544 >>> getname_flags+0xcb/0x580 fs/namei.c:138 >>> getname+0x19/0x20 fs/namei.c:209 >>> do_sys_open+0x2e7/0x6d0 fs/open.c:1053 >>> SYSC_open fs/open.c:1077 [inline] >>> SyS_open+0x2d/0x40 fs/open.c:1072 >>> entry_SYSCALL_64_fastpath+0x29/0xa0 >>> >>> Freed by task 3221: >>> save_stack+0x43/0xd0 mm/kasan/kasan.c:447 >>> set_track mm/kasan/kasan.c:459 [inline] >>> kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 >>> __cache_free mm/slab.c:3488 [inline] >>> kmem_cache_free+0x83/0x2a0 mm/slab.c:3746 >>> putname+0xee/0x130 fs/namei.c:258 >>> do_sys_open+0x31b/0x6d0 fs/open.c:1068 >>> SYSC_open fs/open.c:1077 [inline] >>> SyS_open+0x2d/0x40 fs/open.c:1072 >>> entry_SYSCALL_64_fastpath+0x29/0xa0 >>> >>> The buggy address belongs to the object at ffff8801c50ba000 >>> which belongs to the cache names_cache of size 4096 >>> The buggy address is located 139 bytes to the right of >>> 4096-byte region [ffff8801c50ba000, ffff8801c50bb000) >>> The buggy address belongs to the page: >>> page:ffffea0007142e80 count:1 mapcount:0 mapping:ffff8801c50ba000 >>> index:0x0 compound_mapcount: 0 >>> flags: 0x2fffc0000008100(slab|head) >>> raw: 02fffc0000008100 ffff8801c50ba000 0000000000000000 0000000100000001 >>> raw: ffffea0007145320 ffffea00071433a0 ffff8801dae2c600 0000000000000000 >>> page dumped because: kasan: bad access detected >>> >>> Memory state around the buggy address: >>> ffff8801c50baf80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >>> ffff8801c50bb000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >>>> ffff8801c50bb080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >>> ^ >>> ffff8801c50bb100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >>> ffff8801c50bb180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >>> ================================================================== >>> >>> >>> --- >>> This bug is generated by a dumb bot. It may contain errors. >>> See https://goo.gl/tpsmEJ for details. >>> Direct all questions to syzkaller@googlegroups.com. >>> >>> syzbot will keep track of this bug report. >>> If you forgot to add the Reported-by tag, once the fix for this bug is >>> merged >>> into any tree, please reply to this email with: >>> #syz fix: exact-commit-title >>> If you want to test a patch for this bug, please reply with: >>> #syz test: git://repo/address.git branch >>> and provide the patch inline or as an attachment. >>> To mark this as a duplicate of another syzbot report, please reply with: >>> #syz dup: exact-subject-of-another-report >>> If it's a one-off invalid bug report, please reply with: >>> #syz invalid >>> Note: if the crash happens again, it will cause creation of a new bug >>> report. >>> Note: all commands must start from beginning of the line in the email body. >> > > Thanks. I'm working on it.