Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2973274ybc; Mon, 18 Nov 2019 07:35:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxhI5v7UQb4TSKeHso9m3J6NoJ6nBII0+RHWJmcD9SejpHx04PCP1Dn4IWHpSJPz6mKdMc/ X-Received: by 2002:a17:906:4558:: with SMTP id s24mr27438244ejq.38.1574091331935; Mon, 18 Nov 2019 07:35:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574091331; cv=none; d=google.com; s=arc-20160816; b=y1B18AP3Q/NNgQNnzVOpXDZNsFg9ZeuecbZ2BD3TS8EmMf1xbq1zzRdAtnXcpApBvK lzxOLnXgLhAj01QH2wYjUYJ5/Tqw8ozuougwmgn3UC4j2wj8/K7J3aiC/jpMt7JynT4E lTxnjetBoBpJZcvc7ULY42oqNaq8RqhxYy4VApQ9Bg0HWeKelMYMatjXL7IfVxXGxGWP nF8LX+iBewomtKeLCGS4Lzz8lkcKfa795wVIZf00P9hhmp6NrgkJ6tjvg6hxOWbKg2Qn OkHZjHRrbN8wHDcN9Mxggh+65dbMRodCzhPa0L3Qc9oZtQMlC2iqFkcHgRHec9LhNdrg Zj0w== 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=MC6hbelJpY2ihrrZxRWmuxB6g8NUSOV+ALxeQ6r9VWQ=; b=aJ19jhciSPHWsQ4Wig0p2W7fnpV6ROFpTkOvAOnqasXQSricNiC92kDBgTNO3gUpnw r0ciKjoATYlxMJBYDtqUH3/ffz8oFkEv3T9q6mWoQ3FSIRvWU90EP6u9RrlcPfhe7qjJ mN5bU9fA00obS7KamCqxLEQlpp48guU3/2RBg7VJ890FhipN9SsARiPsv8L3/1C3WtQE qlBgH8Ew7d8Yh1h8uM92qiTOH53NT2r5eQR+wrarMDpUkBWS7Cbfe6n3NpVr4uA1ePaU IOyms81NhOSL6IMLoNR9xCzLgc717LjPHBE4qmErJRqY4pI5d2Wb3H2gYaqTNUPe28GP 9kiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MBWGoonp; 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 pj27si11429436ejb.241.2019.11.18.07.35.07; Mon, 18 Nov 2019 07:35:31 -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=MBWGoonp; 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 S1727311AbfKRPdr (ORCPT + 99 others); Mon, 18 Nov 2019 10:33:47 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38839 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726654AbfKRPdq (ORCPT ); Mon, 18 Nov 2019 10:33:46 -0500 Received: by mail-wr1-f65.google.com with SMTP id i12so20022379wro.5; Mon, 18 Nov 2019 07:33:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MC6hbelJpY2ihrrZxRWmuxB6g8NUSOV+ALxeQ6r9VWQ=; b=MBWGoonp2fPSzTPfLv5UodPdUBVdO9DNIjtTUdHD3x1++MPH69k+yr/Sj8x+Rswe1S 3nH7BWI4t7TRnYcqvFeN/KhOQx2ufrjKQN+trqtHG3gy5Tdisd+EMCHcvSjSYThPWZwa GTTyaVnoxVqKu76XondIew0qvA/bQY3SeyOyth6Fa3dHA5T0ozIK6gVAugPdF0YkLDaT Q1GP2ehRir+tny0fyRrD6lMsjonbKT9jfHcpMUqfb8qZrJ8OBBadRQhZHAT3wwxLt0xZ rIZD/5oSRjubSmewpIN2UTf2VRfwE3ORB62jDn2tMRym/x0tviJvKoST2e3bQShGymkz maWw== 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=MC6hbelJpY2ihrrZxRWmuxB6g8NUSOV+ALxeQ6r9VWQ=; b=sp0BO9EXsyRlZ0hXY/Cwcz/SVblAC9BvjkDOieUxPxzv3cHDZBahPsAFc05ywdjokz MLOdpiSdR06fglWhYHvd0U8gQEMCV7OP/Gkm17QNgItJJGCxCwv6ncmuxh1iIsNQu+mz ISFIAKyh7WmE9oecL5MjRJWSp4LE1+0yXOslcpftpvWaDh/GWIJ7X3Wo8WsPuRdhCVjf gvTNpFP9bvUFxPmBb/uz1upP0JtT80IXTuJskdNyQbuAl0Mgy0S3/TM54vjwRKR7UJYW ZzwP5F4iWEfaDDifGz8DTtCR8Acu5URVwjmE0qGVENVROSYchMONEDOBlkdqT3gtCeZn NpXA== X-Gm-Message-State: APjAAAWIJemLw9oGycBN1G+dUciktc+c1YcJZJIj2HPWhUeRPY7Yg0YK /jN5hntj4pKz87ykgZ78mqnYOVx9s/4Bj+zqDEhEUG/s X-Received: by 2002:a5d:5224:: with SMTP id i4mr15741630wra.303.1574091223130; Mon, 18 Nov 2019 07:33:43 -0800 (PST) MIME-Version: 1.0 References: <0000000000005927bf0596c634a2@google.com> In-Reply-To: <0000000000005927bf0596c634a2@google.com> From: Xin Long Date: Mon, 18 Nov 2019 23:34:34 +0800 Message-ID: Subject: Re: KCSAN: data-race in sctp_assoc_migrate / sctp_hash_obj To: syzbot Cc: davem , elver@google.com, LKML , linux-sctp@vger.kernel.org, Marcelo Ricardo Leitner , network dev , Neil Horman , syzkaller-bugs , Vlad Yasevich 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, Nov 8, 2019 at 2:56 AM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit: 05f22368 x86, kcsan: Enable KCSAN for x86 > git tree: https://github.com/google/ktsan.git kcsan > console output: https://syzkaller.appspot.com/x/log.txt?x=1046796ce00000 > kernel config: https://syzkaller.appspot.com/x/.config?x=87d111955f40591f > dashboard link: https://syzkaller.appspot.com/bug?extid=e3b35fe7918ff0ee474e > 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+e3b35fe7918ff0ee474e@syzkaller.appspotmail.com > > ================================================================== > BUG: KCSAN: data-race in sctp_assoc_migrate / sctp_hash_obj looks we need a better way to get netns in sctp_hash_obj(), I believe in sctp_hash_cmp(), too. > > write to 0xffff8880b67c0020 of 8 bytes by task 18908 on cpu 1: > sctp_assoc_migrate+0x1a6/0x290 net/sctp/associola.c:1091 > sctp_sock_migrate+0x8aa/0x9b0 net/sctp/socket.c:9465 > sctp_accept+0x3c8/0x470 net/sctp/socket.c:4916 > inet_accept+0x7f/0x360 net/ipv4/af_inet.c:734 > __sys_accept4+0x224/0x430 net/socket.c:1754 > __do_sys_accept net/socket.c:1795 [inline] > __se_sys_accept net/socket.c:1792 [inline] > __x64_sys_accept+0x4e/0x60 net/socket.c:1792 > do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > read to 0xffff8880b67c0020 of 8 bytes by task 12003 on cpu 0: > sctp_hash_obj+0x4f/0x2d0 net/sctp/input.c:894 > rht_key_get_hash include/linux/rhashtable.h:133 [inline] > rht_key_hashfn include/linux/rhashtable.h:159 [inline] > rht_head_hashfn include/linux/rhashtable.h:174 [inline] > head_hashfn lib/rhashtable.c:41 [inline] > rhashtable_rehash_one lib/rhashtable.c:245 [inline] > rhashtable_rehash_chain lib/rhashtable.c:276 [inline] > rhashtable_rehash_table lib/rhashtable.c:316 [inline] > rht_deferred_worker+0x468/0xab0 lib/rhashtable.c:420 > process_one_work+0x3d4/0x890 kernel/workqueue.c:2269 > worker_thread+0xa0/0x800 kernel/workqueue.c:2415 > kthread+0x1d4/0x200 drivers/block/aoe/aoecmd.c:1253 > ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352 > > Reported by Kernel Concurrency Sanitizer on: > CPU: 0 PID: 12003 Comm: kworker/0:6 Not tainted 5.4.0-rc3+ #0 > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS > Google 01/01/2011 > Workqueue: events rht_deferred_worker > ================================================================== > > > --- > 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.