Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1326164ybh; Mon, 13 Jul 2020 15:56:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRqq4UMM4GPmYqxgpoQ2PNKKJYm66gJb1DRzsH1uLBn7llJDidhfYZZFX2VhCcpC0obhRS X-Received: by 2002:a17:906:cc13:: with SMTP id ml19mr1886967ejb.288.1594680986114; Mon, 13 Jul 2020 15:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594680986; cv=none; d=google.com; s=arc-20160816; b=1KcdmMSDnD8VWtycIr9H/bUX1FM4KgoDSi9PF+F+x3z5fUDtnmcGl5iVj/WgQ/ihUN DoZwHXBI+SD4DZEfhgRCfwVXQwLI1gHqDwBGAWc6QSox077/IbMYShBE1u/z21PhXqLm pnQ6mRdNMJvgp9k7/E20jBmxB5qmwRBKncZQVXEaBdk/Lq3e87Hqk61x5oRtAqoXO0F1 6O4QNkQzjkse+wpg5CvJ2bo8iFqYTNwUGl0vUUmOUb1m2qVEsvtE0wQixsgkaoKejq7x PXuQwF6J+2hWU5eV6a7/h/9arVaQgog1ChGs3PgvLQIh9p9ZdXYGwUDgkSmbBNwwjjoK UT8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:from:subject:message-id:date :mime-version; bh=jj1P8fWj+QmBL3oVWARuXgxqUpoC+v1KVkS2xZgmtoo=; b=uu6VyitemRPJq3mk3Dhl4AfgGPvAxQTAZI1dd7SLl4aR76A1wzVGTzqZJmr3y2IOg9 Ta1ZwqXpTIq7njG/ClF6zWiVyVEanvRJZ4+bfYccCCz4S0Ati699MPR3QhJ7WPZClacv Wbw+DD9xpNS06oaR4bjydKVMtIcvTPElxAC3lpIVqCAP9pVoLD3aRc8HxBpPXEMTMVIM QcJxIDJcYfqOo/b5Jb1Q3u4D+kfX0gLrij7kV372xf9kkiXHH3dANs7fdnimhS+aYVCw KVEGnMxdOK7/q/0uMs39EhId/Lyaep75SWZ1qDN85vsK9iKH4Z1gVGnlnLZ+LR8O6S96 YKwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si9579346edv.245.2020.07.13.15.56.03; Mon, 13 Jul 2020 15:56:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbgGMWz1 (ORCPT + 99 others); Mon, 13 Jul 2020 18:55:27 -0400 Received: from mail-il1-f199.google.com ([209.85.166.199]:53152 "EHLO mail-il1-f199.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726829AbgGMWzX (ORCPT ); Mon, 13 Jul 2020 18:55:23 -0400 Received: by mail-il1-f199.google.com with SMTP id o17so10724785ilt.19 for ; Mon, 13 Jul 2020 15:55:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=jj1P8fWj+QmBL3oVWARuXgxqUpoC+v1KVkS2xZgmtoo=; b=V/DHnWyMq2qMS29g0l4zOWQPmVBJSGcUJCd4S/RMde5fU37vGkeYawPwU5HIvyZrKR EXEQbbGXm8ULk8LlzClqM2xYYkJoIjDaq2mthsK5g19uiduQieKbCzQjlY3OKIH7k8La XCERtgkaKD00EwDAQrPaz6gdNaBoxD7u6qwWAfoMhDRGCFZeOLXGAgfezdjxeWJQ+1nR erR/HMu00Ske8rQh5BGMsgnAVvfNfTeB3iGL8e2elTCP68Os9SyVbqxnx8xesJFyWdEd 7+fBn/dJjK5Eye1OiHETZDkfH6uS0EVS8gSpP/ZcDCG5HzoX9K3/j4icT2rozu1CqLkk DJdA== X-Gm-Message-State: AOAM533C/6/+obAW8twh4xArbKUUDCvB8VB6CR/rY+crY1WGipvZJYS2 K7NF954Zdl+8ke/n/x3OcYUz/HFGwAWcORkA0sGFcSx2u9SI MIME-Version: 1.0 X-Received: by 2002:a6b:640e:: with SMTP id t14mr2067545iog.39.1594680921636; Mon, 13 Jul 2020 15:55:21 -0700 (PDT) Date: Mon, 13 Jul 2020 15:55:21 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000dd436905aa5a9533@google.com> Subject: KASAN: use-after-free Read in devlink_health_reporter_destroy From: syzbot To: davem@davemloft.net, jiri@mellanox.com, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com 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 Hello, syzbot found the following crash on: HEAD commit: 71930d61 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. git tree: net-next console output: https://syzkaller.appspot.com/x/log.txt?x=10c8d157100000 kernel config: https://syzkaller.appspot.com/x/.config?x=4c5bc87125719cf4 dashboard link: https://syzkaller.appspot.com/bug?extid=dd0040db0d77d52f98a5 compiler: gcc (GCC) 10.1.0-syz 20200507 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1421cd3f100000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13ccfe4f100000 IMPORTANT: if you fix the bug, please add the following tag to the commit: Reported-by: syzbot+dd0040db0d77d52f98a5@syzkaller.appspotmail.com netdevsim netdevsim3 netdevsim0 (unregistering): unset [1, 0] type 2 family 0 port 6081 - 0 ================================================================== BUG: KASAN: use-after-free in devlink_health_reporter_destroy+0x184/0x1d0 net/core/devlink.c:5476 Read of size 8 at addr ffff88808ca11c20 by task kworker/u4:1/21 CPU: 1 PID: 21 Comm: kworker/u4:1 Not tainted 5.8.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18f/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x436 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 devlink_health_reporter_destroy+0x184/0x1d0 net/core/devlink.c:5476 nsim_dev_health_exit+0x8b/0xe0 drivers/net/netdevsim/health.c:317 nsim_dev_reload_destroy+0x132/0x1e0 drivers/net/netdevsim/dev.c:1134 nsim_dev_reload_down+0x6e/0xd0 drivers/net/netdevsim/dev.c:712 devlink_reload+0xc1/0x3a0 net/core/devlink.c:2952 devlink_pernet_pre_exit+0xfb/0x190 net/core/devlink.c:9622 ops_pre_exit_list net/core/net_namespace.c:176 [inline] cleanup_net+0x451/0xa00 net/core/net_namespace.c:591 process_one_work+0x94c/0x1670 kernel/workqueue.c:2269 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415 kthread+0x3b5/0x4a0 kernel/kthread.c:291 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:293 Allocated by task 6819: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:494 kmem_cache_alloc_trace+0x14f/0x2d0 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] __devlink_health_reporter_create+0x91/0x2f0 net/core/devlink.c:5359 devlink_health_reporter_create+0xa1/0x1d0 net/core/devlink.c:5431 nsim_dev_health_init+0x95/0x3a0 drivers/net/netdevsim/health.c:279 nsim_dev_probe+0xada/0xf80 drivers/net/netdevsim/dev.c:1086 really_probe+0x282/0x8a0 drivers/base/dd.c:525 driver_probe_device+0xfe/0x1d0 drivers/base/dd.c:701 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:807 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431 __device_attach+0x28d/0x3f0 drivers/base/dd.c:873 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491 device_add+0xacf/0x1b00 drivers/base/core.c:2680 nsim_bus_dev_new drivers/net/netdevsim/bus.c:336 [inline] new_device_store+0x374/0x5c0 drivers/net/netdevsim/bus.c:215 bus_attr_store+0x72/0xa0 drivers/base/bus.c:122 sysfs_kf_write+0x110/0x160 fs/sysfs/file.c:138 kernfs_fop_write+0x268/0x490 fs/kernfs/file.c:315 vfs_write+0x2b0/0x6b0 fs/read_write.c:576 ksys_write+0x12d/0x250 fs/read_write.c:631 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:384 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 21: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0xf5/0x140 mm/kasan/common.c:455 __cache_free mm/slab.c:3426 [inline] kfree+0x103/0x2c0 mm/slab.c:3757 devlink_health_reporter_free net/core/devlink.c:5449 [inline] devlink_health_reporter_put+0xb7/0xf0 net/core/devlink.c:5456 __devlink_health_reporter_destroy net/core/devlink.c:5463 [inline] devlink_health_reporter_destroy+0x143/0x1d0 net/core/devlink.c:5475 nsim_dev_health_exit+0x8b/0xe0 drivers/net/netdevsim/health.c:317 nsim_dev_reload_destroy+0x132/0x1e0 drivers/net/netdevsim/dev.c:1134 nsim_dev_reload_down+0x6e/0xd0 drivers/net/netdevsim/dev.c:712 devlink_reload+0xc1/0x3a0 net/core/devlink.c:2952 devlink_pernet_pre_exit+0xfb/0x190 net/core/devlink.c:9622 ops_pre_exit_list net/core/net_namespace.c:176 [inline] cleanup_net+0x451/0xa00 net/core/net_namespace.c:591 process_one_work+0x94c/0x1670 kernel/workqueue.c:2269 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415 kthread+0x3b5/0x4a0 kernel/kthread.c:291 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:293 The buggy address belongs to the object at ffff88808ca11c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 32 bytes inside of 512-byte region [ffff88808ca11c00, ffff88808ca11e00) The buggy address belongs to the page: page:ffffea0002328440 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88808ca11000 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00024ba648 ffffea0002a32788 ffff8880aa000a80 raw: ffff88808ca11000 ffff88808ca11000 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808ca11b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808ca11b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88808ca11c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808ca11c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808ca11d00: 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. syzbot can test patches for this bug, for details see: https://goo.gl/tpsmEJ#testing-patches