Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4867619ybi; Tue, 28 May 2019 03:58:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkFr9T7BtcttuMoxEvP7Z57/9ccB8It75p/7wmLjxulFMXVDhpnWO+rxRJmFNVXPUhKlEO X-Received: by 2002:a62:7513:: with SMTP id q19mr139692155pfc.108.1559041082313; Tue, 28 May 2019 03:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559041082; cv=none; d=google.com; s=arc-20160816; b=eD7idjMKPkNEC8i8/LiYdstogKtJz7n2s63khKKEZ3YjqwWbevfcbM7P9jIwA96OKk z6yjCd16XhEtBGOrSp0OA4FwSFx1FalMVYLMLmNSw+Wm+5Yx5M9cU2K6dqj9NFVfT6hV kanrxwsYFU6iQ63BC25UqymEtDTAyzZ9SkrxmdHmg2N0jeYUYAg8CQhTlwlZe5gxfSD5 hvy95Bi88DmAAln7wXJ+Pwe1MpKWb2dbjQQdyhKhkdt4zQOTCcl44JCwUMPNCy51fE5g zam58GTC8qEilspxstxMlY2kiygpVKf3xcloOBFZuDsaWXyaxrqNGxEQsxWXHGhB/7tZ YX2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=uyMRBQjkY9KIYhPYYQRcVd0CKdQJA0ZUN0nxdjEGXW8=; b=TldgmMM+YGFdBKNV0l4+F9sbJKWYNqdSLTa25fsh0qZacFOASlQJwhTxYGO7jhVilb UTa5dvt5x2nuhKKAT2PLSs6zNkqbK2tS9EjeM5a3qZ64xReKA4+qhU8aDSelIZhUuZhF sEFh3VWlWnpruyzT7FfzWRmFVlEhTX+Yu34NdIvQgESQ+V2DbZP0X89Y+mo5it+QwmdM DLTt8t25bn94MBMuhnWx7j2iR+BIVRTC8yJ+uP56KMRLtAuvMFGxUVzCecgCbh7giwR9 0pV4xJcnkRUZ1x+vNptOhHDrg2xDwUOwYcFpvqFS28OsKHxhrpFKLHE9R5UrEycwETc/ srWw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si9605595plr.138.2019.05.28.03.57.47; Tue, 28 May 2019 03:58:02 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726753AbfE1K4h (ORCPT + 99 others); Tue, 28 May 2019 06:56:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41660 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726282AbfE1K4g (ORCPT ); Tue, 28 May 2019 06:56:36 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD432C05D3F4; Tue, 28 May 2019 10:56:36 +0000 (UTC) Received: from steredhat.redhat.com (ovpn-117-13.ams2.redhat.com [10.36.117.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 391E97D59A; Tue, 28 May 2019 10:56:25 +0000 (UTC) From: Stefano Garzarella To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, Stefan Hajnoczi , "David S. Miller" , "Michael S . Tsirkin" Subject: [PATCH 0/4] vsock/virtio: several fixes in the .probe() and .remove() Date: Tue, 28 May 2019 12:56:19 +0200 Message-Id: <20190528105623.27983-1-sgarzare@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 28 May 2019 10:56:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock before registering the driver", Stefan pointed out some possible issues in the .probe() and .remove() callbacks of the virtio-vsock driver. This series tries to solve these issues: - Patch 1 postpones the 'the_virtio_vsock' assignment at the end of the .probe() to avoid that some sockets queue works when the initialization is not finished. - Patches 2 and 3 stop workers before to call vdev->config->reset(vdev) to be sure that no one is accessing the device, and adds another flush at the end of the .remove() to avoid use after free. - Patch 4 free also used buffers in the virtqueues during the .remove(). Stefano Garzarella (4): vsock/virtio: fix locking around 'the_virtio_vsock' vsock/virtio: stop workers during the .remove() vsock/virtio: fix flush of works during the .remove() vsock/virtio: free used buffers during the .remove() net/vmw_vsock/virtio_transport.c | 105 ++++++++++++++++++++++++++----- 1 file changed, 90 insertions(+), 15 deletions(-) -- 2.20.1