Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4424312pxb; Mon, 21 Feb 2022 21:11:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzulRWwyhHQ0u4Yq8sBlzGiNyzhZpeGpXpX/6gD+LlCHS+O18JgMvuMBOMaSOm2QhnMD8w4 X-Received: by 2002:a17:903:292:b0:149:460a:9901 with SMTP id j18-20020a170903029200b00149460a9901mr21797939plr.44.1645506661472; Mon, 21 Feb 2022 21:11:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1645506661; cv=pass; d=google.com; s=arc-20160816; b=UaW8P73WIv984z3VO1cn60S6gOIycrfBrDvCZmfoPyjdwos5P8UD3kav8O96QwvtFY xBEMV8wpPKGs9Dn1UJ32KX7mfnOsf/qm59KezRANkjysF27F4pz0dhYdnKZwtzXSSv1z 1mxXZynLOi6uI7Kp3lAcsLKVwaQGZ/9DjP8sGRM66hx0wXSZyCb9pCrQ6y0Umo/Tx0PB Y+OgI8oUOTRZFQ52MhGCPp5M2BXrMU1SjEeCHmJ+4+RNg+LMVJqhg3xrxY8AIsaZSPno 9YnUbBlvE+8/l/nPrBrs8dTrOdjd0LxJixYZUMKd26eHh6fc4t6zqe0YQbxONrECmNGu KKMA== ARC-Message-Signature: i=2; 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=fsIUXYehvEEwhdbyTVnwdNs58dADoiqa7FrNZpH5MvQ=; b=lB6EfuH1VdKuRXzdvmg7OtbHi7LjiMGDz/WUg+Oh2prlY5u5S5b1a3P+GnGhe6Ae4y iQd1Ra9zFsfQZGtx7XMMuyU+BMW0qDF9TZR35Am4o+JhOfB1SAhC1GrSeWzEu0wsvlG2 7SIUhBOEZMvE1ddptpofezRU/u+KA+w3Y5iYVmHXWMpv3JDgMgUa6/3o7vn120jfAtaG A7hdX+IBiiyar4hbRuGEeRg3EhLlRvRxOIYlkCD6QrLwVlKIJk7BEb55Ajrb+qALSdxB XTXVBi6/JVebbtu2yv6IYDx6LL5L9cYdUa/5cR+R9vLn3PXhoPqlm94AkwUqf+c+Bt6P C4BQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@anirudhrb.com header.s=zoho header.b=pIbnLjTv; arc=pass (i=1 spf=pass spfdomain=anirudhrb.com dkim=pass dkdomain=anirudhrb.com dmarc=pass fromdomain=anirudhrb.com>); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y16-20020a17090a6c9000b001b8e0573361si1170602pjj.54.2022.02.21.21.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:11:01 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@anirudhrb.com header.s=zoho header.b=pIbnLjTv; arc=pass (i=1 spf=pass spfdomain=anirudhrb.com dkim=pass dkdomain=anirudhrb.com dmarc=pass fromdomain=anirudhrb.com>); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9EE36CCC70; Mon, 21 Feb 2022 20:43:50 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232277AbiBUSPS (ORCPT + 99 others); Mon, 21 Feb 2022 13:15:18 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232294AbiBUSMe (ORCPT ); Mon, 21 Feb 2022 13:12:34 -0500 Received: from sender4-of-o53.zoho.com (sender4-of-o53.zoho.com [136.143.188.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B56E195; Mon, 21 Feb 2022 10:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645466599; cv=none; d=zohomail.com; s=zohoarc; b=YZyMF51P4+/S3dlgHlVUpxcI7aWblCY2sMq8Mn+tA5JO5mh2/dGB1qSkvIywCFZMGWxNADVWG3JvceJWo0j+8DnPkt+j7/d35uztkjl9wjpIxh+ucPTAl/0dwHmt02PiaSqHXZkWlXmlSrnaP9egmkFqAdSN/rSxunRFP5K6acQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645466599; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=fsIUXYehvEEwhdbyTVnwdNs58dADoiqa7FrNZpH5MvQ=; b=NvDSgUrgG2JK77anNLKyUhkXHdKaC5MSGK1LjlVJNAnX5Jsbw6nmpyNvN6KfcDUM2VMW6N9R9vG+/YOplUKG/kTA4BtA1JZXTrvNHiztsWiWwXGA3sXBTApJnJCNXkgaYF2kKSiP1zheqAuAmUSXEKYqvjJlkILzmbKoFeE3Jxk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=anirudhrb.com; spf=pass smtp.mailfrom=mail@anirudhrb.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1645466599; s=zoho; d=anirudhrb.com; i=mail@anirudhrb.com; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:In-Reply-To; bh=fsIUXYehvEEwhdbyTVnwdNs58dADoiqa7FrNZpH5MvQ=; b=pIbnLjTv5NJg42fxoUE97UNJyrtYslgTpEEwhf8FdicVjVcQBYZsqyxvEUboafkZ +VGYCbnfFkHHKrPiu0l0pSOhitli54K1wStQJTP0RNkgCZWmc6Ak+xTpQ5S0zM6dSg7 sFjN+o6xvbtIPIpq2CvLUxXU6P1j5MMzaqloFxPY= Received: from anirudhrb.com (49.207.206.107 [49.207.206.107]) by mx.zohomail.com with SMTPS id 1645466598393587.852076311628; Mon, 21 Feb 2022 10:03:18 -0800 (PST) Date: Mon, 21 Feb 2022 23:33:11 +0530 From: Anirudh Rayabharam To: Stefano Garzarella Cc: "Michael S. Tsirkin" , kernel list , Mike Christie , Jason Wang , netdev , Linux Virtualization , Stefan Hajnoczi , kvm , Hillf Danton Subject: Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing Message-ID: References: <20220221114916.107045-1-sgarzare@redhat.com> <20220221164420.cnhs6sgxizc6tcok@sgarzare-redhat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220221164420.cnhs6sgxizc6tcok@sgarzare-redhat> X-ZohoMailClient: External X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, Feb 21, 2022 at 05:44:20PM +0100, Stefano Garzarella wrote: > On Mon, Feb 21, 2022 at 09:44:39PM +0530, Anirudh Rayabharam wrote: > > On Mon, Feb 21, 2022 at 02:59:30PM +0100, Stefano Garzarella wrote: > > > On Mon, Feb 21, 2022 at 12:49 PM Stefano Garzarella wrote: > > > > > > > > vhost_vsock_stop() calls vhost_dev_check_owner() to check the device > > > > ownership. It expects current->mm to be valid. > > > > > > > > vhost_vsock_stop() is also called by vhost_vsock_dev_release() when > > > > the user has not done close(), so when we are in do_exit(). In this > > > > case current->mm is invalid and we're releasing the device, so we > > > > should clean it anyway. > > > > > > > > Let's check the owner only when vhost_vsock_stop() is called > > > > by an ioctl. > > > > > > > > Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko") > > > > Cc: stable@vger.kernel.org > > > > Reported-by: syzbot+1e3ea63db39f2b4440e0@syzkaller.appspotmail.com > > > > Signed-off-by: Stefano Garzarella > > > > --- > > > > drivers/vhost/vsock.c | 14 ++++++++------ > > > > 1 file changed, 8 insertions(+), 6 deletions(-) > > > > > > Reported-and-tested-by: syzbot+0abd373e2e50d704db87@syzkaller.appspotmail.com > > > > I don't think this patch fixes "INFO: task hung in vhost_work_dev_flush" > > even though syzbot says so. I am able to reproduce the issue locally > > even with this patch applied. > > Are you using the sysbot reproducer or another test? > In that case, can you share it? I am using the syzbot reproducer. > > From the stack trace it seemed to me that the worker accesses a zone that > has been cleaned (iotlb), so it is invalid and fails. Would the thread hang in that case? How? Thanks, - Anirudh. > That's why I had this patch tested which should stop the worker before > cleaning. > > Thanks, > Stefano >