Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp194035pxb; Thu, 17 Feb 2022 01:48:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHOodmE1tGBKmkiiARa0AlEjjMtI5MS9mFe2w+fejkWVRWfjGAAcvmMS5ZYDO7K33UxpU6 X-Received: by 2002:a17:903:2451:b0:14f:b91:fe3c with SMTP id l17-20020a170903245100b0014f0b91fe3cmr2184632pls.120.1645091307048; Thu, 17 Feb 2022 01:48:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645091307; cv=none; d=google.com; s=arc-20160816; b=nPyfaPl3S9xSexbx6yhLycluP6TzRuknvaGcPC3ropqtQx4BMQ0CPxP63Yiw2T6HM1 VZclo3+EcLivxyDxjPfApsTZn8TZuIJxT/JeWUe7YJ0hC/agdG5wG0en36iXuDusc5Zm M0JvIBWCfv3DR4V970CsHcKZ7kwH6vi0U7SCnX4avfCf1GTZS63p+QqYoEHq5wGwLocd uXvNnzsCqDPl+C+r1t+AhFBBXSPgXJNzWUTATOXBl+0Jbntoqouy4aeUJZ4BIMFWCTS0 XMvJAUDUdufvO2+lB6UF8mRFJypzx9l69hwMXCJXj05etqfYmn0+ekz2jrDT6DDKDacq Lmwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=w+SWlmqdTXW/vwpa/W1PTCZvRCAVwOXfVJtRO06yo4I=; b=SOYwNBaQvbmaiEJ9LVp1Fb9om8CfBozfNUD0PFewLM6jEOzICwz5/3EiiIV7l6HcZr liliDbxUJ4goW+VWfNstK6dxZ6FI7JmWi3TiRa/a0krPlf8+v4xf86utzvZVdZr/uenR SWY5IMthUj16S9FhywNdDxAY809ohiSi8B45aQyIe/mJf+iNt3z8aktiIgsaHsjSPj4C jgKWkC4sObpNEcJtUXZCo50n3pI2Qy7MSr+X9r9ermwhLmygXRUWTGH53EJ2otQ6qaEO nSeuRF+2OHcQUA2mvm/8oKFvOjll2NUjqPWPk7yzZa8I1sj0lsi5/T0f1XLh7WmK61c7 LGsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i2rL9DXK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9si8703608pgu.353.2022.02.17.01.48.13; Thu, 17 Feb 2022 01:48:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i2rL9DXK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236664AbiBQHux (ORCPT + 99 others); Thu, 17 Feb 2022 02:50:53 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236673AbiBQHuw (ORCPT ); Thu, 17 Feb 2022 02:50:52 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4A2E52A39EE for ; Wed, 16 Feb 2022 23:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645084237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=w+SWlmqdTXW/vwpa/W1PTCZvRCAVwOXfVJtRO06yo4I=; b=i2rL9DXKEnjnfpAazslJZkk1JT1YdIDASkVxmRvhTUKZt5dYgkDNB/Bu9FZroYw9pSU15+ R8aK81n2+S+dYOK1lhyacuaZBrvGohz4vwpA5oyVGAXzNDsCJbb+/mOSSeoZINCq5aZgrI hEJcJZAwVj0Qzh1dwmMJEaMiOAnqtNc= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-657-JgmgxhVUMS-urnCPLAsKrQ-1; Thu, 17 Feb 2022 02:50:35 -0500 X-MC-Unique: JgmgxhVUMS-urnCPLAsKrQ-1 Received: by mail-wm1-f69.google.com with SMTP id v130-20020a1cac88000000b0037e3d70e7e1so1097531wme.1 for ; Wed, 16 Feb 2022 23:50:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=w+SWlmqdTXW/vwpa/W1PTCZvRCAVwOXfVJtRO06yo4I=; b=JbB0vl4OpS9U6qUDhkIEftmQZSqSOxXUpad4YAnxQrnj083JlrlCb50YXX0h+DEXh6 ujM495UVqzNO6AYpqGn1uKVuD3MMacC31lqItCnM3iNvJV9zTaJk9A0HUHvIAAj1WW/E tLKFSqc6mxPD+4/FvAmurEOQyoYCq9oojidM7dKPu3OItjpAtVlbUCv1SrQGa7EpntvS x3Qw0LzyzOS7SyuDimYgnCxog/KHxR6rwC9pgT4caXkmN+/WbdgNZrJhT7Ul15A4iKIb ah6wAB0sEgliN1sPwGy7vTFN19NzGZaA2tsezVbrtaFBnjuspEgA2uGbcCjVXp1Q6upy 0n/Q== X-Gm-Message-State: AOAM533ueKCnhh1dxdSIezZp7KiQR6vjuF1qfJSKw8EQxJLwY2TgN5Ad nkqlIQvakp2YM0ocE+gyjjDhOuVV7BqANzz++4HoNZ+B9yKmXGyjaaSLsm5rsgdKzORm9ngSw7o 7QJaBPZx2NnTRC0m/EirXwM+0 X-Received: by 2002:adf:9f42:0:b0:1e7:e751:9656 with SMTP id f2-20020adf9f42000000b001e7e7519656mr1268881wrg.590.1645084233485; Wed, 16 Feb 2022 23:50:33 -0800 (PST) X-Received: by 2002:adf:9f42:0:b0:1e7:e751:9656 with SMTP id f2-20020adf9f42000000b001e7e7519656mr1268862wrg.590.1645084233179; Wed, 16 Feb 2022 23:50:33 -0800 (PST) Received: from redhat.com ([2.55.139.83]) by smtp.gmail.com with ESMTPSA id g12sm469088wmq.28.2022.02.16.23.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 23:50:32 -0800 (PST) Date: Thu, 17 Feb 2022 02:50:29 -0500 From: "Michael S. Tsirkin" To: Jason Wang Cc: syzbot , kvm , linux-kernel , netdev , syzkaller-bugs@googlegroups.com, virtualization , Stefan Hajnoczi , Stefano Garzarella Subject: Re: [syzbot] WARNING in vhost_dev_cleanup (2) Message-ID: <20220217024359-mutt-send-email-mst@kernel.org> References: <0000000000006f656005d82d24e2@google.com> <20220217023550-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 17, 2022 at 03:39:48PM +0800, Jason Wang wrote: > On Thu, Feb 17, 2022 at 3:36 PM Michael S. Tsirkin wrote: > > > > On Thu, Feb 17, 2022 at 03:34:13PM +0800, Jason Wang wrote: > > > On Thu, Feb 17, 2022 at 10:01 AM syzbot > > > wrote: > > > > > > > > Hello, > > > > > > > > syzbot found the following issue on: > > > > > > > > HEAD commit: c5d9ae265b10 Merge tag 'for-linus' of git://git.kernel.org.. > > > > git tree: upstream > > > > console output: https://syzkaller.appspot.com/x/log.txt?x=132e687c700000 > > > > kernel config: https://syzkaller.appspot.com/x/.config?x=a78b064590b9f912 > > > > dashboard link: https://syzkaller.appspot.com/bug?extid=1e3ea63db39f2b4440e0 > > > > compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 > > > > > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > > > Reported-by: syzbot+1e3ea63db39f2b4440e0@syzkaller.appspotmail.com > > > > > > > > WARNING: CPU: 1 PID: 10828 at drivers/vhost/vhost.c:715 vhost_dev_cleanup+0x8b8/0xbc0 drivers/vhost/vhost.c:715 > > > > Modules linked in: > > > > CPU: 0 PID: 10828 Comm: syz-executor.0 Not tainted 5.17.0-rc4-syzkaller-00051-gc5d9ae265b10 #0 > > > > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 > > > > RIP: 0010:vhost_dev_cleanup+0x8b8/0xbc0 drivers/vhost/vhost.c:715 > > > > > > Probably a hint that we are missing a flush. > > > > > > Looking at vhost_vsock_stop() that is called by vhost_vsock_dev_release(): > > > > > > static int vhost_vsock_stop(struct vhost_vsock *vsock) > > > { > > > size_t i; > > > int ret; > > > > > > mutex_lock(&vsock->dev.mutex); > > > > > > ret = vhost_dev_check_owner(&vsock->dev); > > > if (ret) > > > goto err; > > > > > > Where it could fail so the device is not actually stopped. > > > > > > I wonder if this is something related. > > > > > > Thanks > > > > > > But then if that is not the owner then no work should be running, right? > > Could it be a buggy user space that passes the fd to another process > and changes the owner just before the mutex_lock() above? > > Thanks Maybe, but can you be a bit more explicit? what is the set of conditions you see that can lead to this? > > > > > > > > > > > Code: c7 85 90 01 00 00 00 00 00 00 e8 53 6e a2 fa 48 89 ef 48 83 c4 20 5b 5d 41 5c 41 5d 41 5e 41 5f e9 7d d6 ff ff e8 38 6e a2 fa <0f> 0b e9 46 ff ff ff 48 8b 7c 24 10 e8 87 00 ea fa e9 75 f7 ff ff > > > > RSP: 0018:ffffc9000fe6fa18 EFLAGS: 00010293 > > > > RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000 > > > > RDX: ffff888021b63a00 RSI: ffffffff86d66fe8 RDI: ffff88801cc200b0 > > > > RBP: ffff88801cc20000 R08: 0000000000000001 R09: 0000000000000001 > > > > R10: ffffffff817f1e08 R11: 0000000000000000 R12: ffff88801cc200d0 > > > > R13: ffff88801cc20120 R14: ffff88801cc200d0 R15: 0000000000000002 > > > > FS: 0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 > > > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > > CR2: 0000001b2de25000 CR3: 000000004c9cd000 CR4: 00000000003506f0 > > > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > > Call Trace: > > > > > > > > vhost_vsock_dev_release+0x36e/0x4b0 drivers/vhost/vsock.c:771 > > > > __fput+0x286/0x9f0 fs/file_table.c:313 > > > > task_work_run+0xdd/0x1a0 kernel/task_work.c:164 > > > > exit_task_work include/linux/task_work.h:32 [inline] > > > > do_exit+0xb29/0x2a30 kernel/exit.c:806 > > > > do_group_exit+0xd2/0x2f0 kernel/exit.c:935 > > > > get_signal+0x45a/0x2490 kernel/signal.c:2863 > > > > arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 > > > > handle_signal_work kernel/entry/common.c:148 [inline] > > > > exit_to_user_mode_loop kernel/entry/common.c:172 [inline] > > > > exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 > > > > __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] > > > > syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 > > > > do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 > > > > entry_SYSCALL_64_after_hwframe+0x44/0xae > > > > RIP: 0033:0x7f4027a46481 > > > > Code: Unable to access opcode bytes at RIP 0x7f4027a46457. > > > > RSP: 002b:00007f402808ba68 EFLAGS: 00000206 ORIG_RAX: 0000000000000038 > > > > RAX: fffffffffffffffc RBX: 00007f402622e700 RCX: 00007f4027a46481 > > > > RDX: 00007f402622e9d0 RSI: 00007f402622e2f0 RDI: 00000000003d0f00 > > > > RBP: 00007f402808bcb0 R08: 00007f402622e700 R09: 00007f402622e700 > > > > R10: 00007f402622e9d0 R11: 0000000000000206 R12: 00007f402808bb1e > > > > R13: 00007f402808bb1f R14: 00007f402622e300 R15: 0000000000022000 > > > > > > > > > > > > > > > > --- > > > > This report 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 issue. See: > > > > https://goo.gl/tpsmEJ#status for how to communicate with syzbot. > > > > > >