Received: by 10.213.65.68 with SMTP id h4csp1998746imn; Sun, 8 Apr 2018 16:59:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+iPviuVQ6iFX7NNAh5EJKwaKksa0VYvmpaKfrsr09UrGEB69mLNVpa2ivGnwoXJC3HRGAY X-Received: by 2002:a17:902:51ce:: with SMTP id y72-v6mr35854044plh.157.1523231977883; Sun, 08 Apr 2018 16:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523231977; cv=none; d=google.com; s=arc-20160816; b=Aii19GqqSpPGUFBcMIqYBitXdL0uQg/75xCe12eCu9cGaUbGIkdC6X+l570YX7et/S yzXiKCny9cPcTIo4cg376M8JbMy9CnQSzkgKlwrNJ8k9IbKmoZmhl9bwWhbNmhlRiIVt rYYCB8/PX25027k9q+Zyxsxdwvm+B9uP6oQ3J1Chv7ynArMZ/L05N7kEEyCVjXASU47Y ZGXQUwrJqehLFSmdho9tN48z2phunZexGViwfAeCEDjoa9TMXQwdbGGc75vy33FbKu7b JDERaxav35GRdMJW057JDxJIjYXSikl162Cs07Dgpiz1NwYRgKGlqC/Zq1/COWfVDkvH jPPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=YPmcGdwo5VW/t4n69Uaw7yuEdaDxtLAp9vVq/aXuBVs=; b=FyA6cqgZebgmSSIUOW5efY7DptnSyf1gNs2xMBb9IYC/IyY3F9PZUWgnKGJ8BjbEtq y0GTQOOolUzVHZIHdoxdMQMwitvRt7i1KekIMthhEHUvXa11vgihWIVh0JMo11VUiylw 7gJYhYrmVgzgcgS6eG9w6BpV3dDekaWzCvuEVs2BSVWKylUXYzywYSogMvTOJ7JllX26 UDDONBqDzwIuo6WI9rofgfbK3Hs/cvfKJ3yyB0Fj8VHxmKYG3vgZHw4aAVkkJiWzvSWg CE4XGI0i92tBcgAfs9ZKoB+kH+EPgX9DYeEYGma4mBwISr1hlT5WNtoi4IUqhsAGgGmi QCEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rUnFNdre; 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=QUARANTINE 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 o5-v6si3687013pll.269.2018.04.08.16.59.01; Sun, 08 Apr 2018 16:59:37 -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=@gmail.com header.s=20161025 header.b=rUnFNdre; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752623AbeDHXRR (ORCPT + 99 others); Sun, 8 Apr 2018 19:17:17 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:38671 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbeDHXRP (ORCPT ); Sun, 8 Apr 2018 19:17:15 -0400 Received: by mail-pf0-f193.google.com with SMTP id y69so4664495pfb.5; Sun, 08 Apr 2018 16:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YPmcGdwo5VW/t4n69Uaw7yuEdaDxtLAp9vVq/aXuBVs=; b=rUnFNdrecyulZRuxioZPKc7T0bCFXSE/7XuyV0rMYqTXyYyST+F2+aZxnjd1DEnatW uf+Mp4DcjH837IIUAQV/TLG1PBTMkN64wTU3uolWg16iATZQBoLd1QYCwog9cozLZBSa +x1y/oFRTkhWGcBq3XxT11DALrBbWZgnDn2M/4cW1AQuxqL3hpeAYdQXkCQD/4tdmJZs 2fx7yGzXRn5GWnd0B4suSB0EGE4N2KNFN6bHcTjnF1p8tmAMecRjTOAIx9w23Kb1NG6x Inyx1R+njo2HKamPDxZmruA3fpcdskn0pwohhnma3cMlMrAdbIzGp7qNt96nK7FFMcn3 vuYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=YPmcGdwo5VW/t4n69Uaw7yuEdaDxtLAp9vVq/aXuBVs=; b=H84BXaRdtsU4HRKEOM9gBbB//moDRupdW5SC0QEhfYmvk4YaP2qBFwBC998tRfKipj DOKAmZHsVoxffnO69QFagu5pH4xTmmKrs1g2S42gKaQEmuo1fcqLj1Spzxg9sp9JagPf TosDYLl6tSIk+wIv7N6+1DxeDrieMF/z/u7n+YD+SLOiasLewbwyqkJdjab4wi1vdcQU ob75EJem8wjpXLPJ7RNWTSH0CbSAtILSVxBFTzCUDxL1zEMfe2TA7tlvo4/0gJ9wnMwe HcaxAayiHOQnXZM9knx6xBWwa/BR0Vg1JDS6eNuCSuttAZI1lkycFIAFh7z45ZUZRDfs 1PBg== X-Gm-Message-State: AElRT7GgKMR0OKuxb/Rtwi3rQvl/5r1sYiVbdjHqY5RNnz2AB0qpMd7A FI4Atz+iX440dnOrWfALsTjslqIHLlE= X-Received: by 10.101.99.8 with SMTP id g8mr22871177pgv.182.1523229434554; Sun, 08 Apr 2018 16:17:14 -0700 (PDT) Received: from sol.localdomain (c-67-185-97-198.hsd1.wa.comcast.net. [67.185.97.198]) by smtp.gmail.com with ESMTPSA id z78sm28917119pfd.23.2018.04.08.16.17.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 08 Apr 2018 16:17:14 -0700 (PDT) Date: Sun, 8 Apr 2018 16:17:56 -0700 From: Eric Biggers To: linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, Santosh Shilimkar Cc: syzbot , davem@davemloft.net, kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com, yoshfuji@linux-ipv6.org Subject: Re: KASAN: use-after-free Read in inet_create Message-ID: <20180408231756.GI685@sol.localdomain> References: <001a1144d1c8e819f6055fee7118@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001a1144d1c8e819f6055fee7118@google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+RDS list and maintainer] On Sat, Dec 09, 2017 at 12:50:01PM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 82bcf1def3b5f1251177ad47c44f7e17af039b4b > git://git.cmpxchg.org/linux-mmots.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console output is attached. > > Unfortunately, I don't have any reproducer for this bug yet. > > > ================================================================== > BUG: KASAN: use-after-free in inet_create+0xda0/0xf50 net/ipv4/af_inet.c:338 > Read of size 4 at addr ffff8801bde28554 by task kworker/u4:5/3492 > > CPU: 0 PID: 3492 Comm: kworker/u4:5 Not tainted 4.15.0-rc2-mm1+ #39 > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS > Google 01/01/2011 > Workqueue: krdsd rds_connect_worker > 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_load4_noabort+0x14/0x20 mm/kasan/report.c:429 > inet_create+0xda0/0xf50 net/ipv4/af_inet.c:338 > __sock_create+0x4d4/0x850 net/socket.c:1265 > sock_create_kern+0x3f/0x50 net/socket.c:1311 > rds_tcp_conn_path_connect+0x26f/0x920 net/rds/tcp_connect.c:108 > rds_connect_worker+0x156/0x1f0 net/rds/threads.c:165 > process_one_work+0xbfd/0x1bc0 kernel/workqueue.c:2113 > worker_thread+0x223/0x1990 kernel/workqueue.c:2247 > kthread+0x37a/0x440 kernel/kthread.c:238 > ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:524 > > Allocated by task 3362: > 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:3548 > kmem_cache_zalloc include/linux/slab.h:695 [inline] > net_alloc net/core/net_namespace.c:362 [inline] > copy_net_ns+0x196/0x580 net/core/net_namespace.c:402 > create_new_namespaces+0x425/0x880 kernel/nsproxy.c:107 > unshare_nsproxy_namespaces+0xae/0x1e0 kernel/nsproxy.c:206 > SYSC_unshare kernel/fork.c:2421 [inline] > SyS_unshare+0x653/0xfa0 kernel/fork.c:2371 > entry_SYSCALL_64_fastpath+0x1f/0x96 > > Freed by task 35: > 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:3492 [inline] > kmem_cache_free+0x77/0x280 mm/slab.c:3750 > net_free+0xca/0x110 net/core/net_namespace.c:378 > net_drop_ns.part.11+0x26/0x30 net/core/net_namespace.c:385 > net_drop_ns net/core/net_namespace.c:384 [inline] > cleanup_net+0x895/0xb60 net/core/net_namespace.c:502 > process_one_work+0xbfd/0x1bc0 kernel/workqueue.c:2113 > worker_thread+0x223/0x1990 kernel/workqueue.c:2247 > kthread+0x37a/0x440 kernel/kthread.c:238 > ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:524 > > The buggy address belongs to the object at ffff8801bde28080 > which belongs to the cache net_namespace of size 6272 > The buggy address is located 1236 bytes inside of > 6272-byte region [ffff8801bde28080, ffff8801bde29900) > The buggy address belongs to the page: > page:00000000df6a4dc0 count:1 mapcount:0 mapping:00000000553659f1 index:0x0 > compound_mapcount: 0 > flags: 0x2fffc0000008100(slab|head) > raw: 02fffc0000008100 ffff8801bde28080 0000000000000000 0000000100000001 > raw: ffffea0006f75da0 ffffea0006f60220 ffff8801d989fe00 0000000000000000 > page dumped because: kasan: bad access detected > > Memory state around the buggy address: > ffff8801bde28400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ffff8801bde28480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > > ffff8801bde28500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ^ > ffff8801bde28580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ffff8801bde28600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ================================================================== > > > --- > 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. > Please credit me with: Reported-by: syzbot > > syzbot will keep track of this bug report. > Once a fix for this bug is merged into any tree, reply to this email with: > #syz fix: exact-commit-title > 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. > This is still happening regularly, though syzbot hasn't been able to generate a reproducer yet. All the reports seem to involve rds_connect_worker() encountering a freed network namespace (struct net) when calling sock_create_kern() from rds_tcp_conn_path_connect(). Probably something in RDS needs to be taking a reference to the network namespace and isn't, or the RDS workqueue isn't being shut down correctly. You can see all reports of this on the syzbot dashboard at https://syzkaller.appspot.com/bug?id=1f45ae538a0453220337ccb84962249fdd67107f. Last one was April 5 on Linus' tree (commit 3e968c9f1401088). - Eric