Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1138735pxb; Thu, 15 Apr 2021 15:18:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1Ad6bZitkTaN6PgLgpffeMFlguSQOygjYyAkw663K0UYfW9ussn/nmUu44OCN0ikMJt9a X-Received: by 2002:a63:3402:: with SMTP id b2mr5327576pga.190.1618525097833; Thu, 15 Apr 2021 15:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618525097; cv=none; d=google.com; s=arc-20160816; b=Zc4AGVngHGf9tuPEJmOlbkatQ/Vy9cGjd/Hhe2hihHggWpZUuiWqljwn9tszKGWIVk E7MFouZqQwNL8pm9W6j/USrq1UMyI1SydYRp2SbZ6HJd/C2/e9z2ArmqIgQsvglPsQBv BJgM6800IEFA/ITKyLp4x4P45J+geo7N4PzjBHrnKlMjrrYlGOtDy1czQhMlG35xUv0I +vI/8eydUy2zSHAgJvOAw/IdhIh6Gu8j02p5oxI/aox0sekQcarHbAYP+uqRoKFbu5vd xCwpi5CTotAMLVMhW3Tpzoh68CNlwZcDr6czI0jTW7KK+PkesuTGrH/pe9cdLac//tRS f6Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=a4DOTBbYEKnT3EnjXiuFlp4qBusHe05Bi/ZftDfP8iI=; b=xQotE2OrRdvJYKZlHzHVehb0UycEuSA2g6HizYuNhf+mXPXuHU+OEoRPsNBhX2++Y0 NrOm5Ca9E/EtlWnqfptTG9+ScxtDzq6co/2cRulMNPR+43Ngbh1qQgpbugiT7XY4WW/Y hobdQoQsDJOYvDF7X+huvK4wuyhz+XSxaZxCKmD2L17RabT/5CIHgGQReqHpYQlC2XLb gYttQ/WwgPNTYfsz5KLq1844ZqZCxGuE+VEz7q6zgsvNSLI3Jgq3m/703xTaiuUmUUJC eypUguYqhMpQP+UKEHiEpgNs8A9MBLMRfO7xD9xstEzeWwQwTO5rIti5Wx5k8UVgJXA3 /pGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TMs3OTko; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si4450441pgg.19.2021.04.15.15.18.01; Thu, 15 Apr 2021 15:18:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TMs3OTko; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236208AbhDOVun (ORCPT + 99 others); Thu, 15 Apr 2021 17:50:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235892AbhDOVum (ORCPT ); Thu, 15 Apr 2021 17:50:42 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4449EC061574 for ; Thu, 15 Apr 2021 14:50:19 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id v19-20020a0568300913b029028423b78c2dso15358264ott.8 for ; Thu, 15 Apr 2021 14:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a4DOTBbYEKnT3EnjXiuFlp4qBusHe05Bi/ZftDfP8iI=; b=TMs3OTkoZpQrTMVqb9siJB81H/SU2Cyvmxywxt+jCDPZDntfBjWKju8NkqmM8LRauy 7mq11Y1DF+8t6GO9EJC+OGSDXGMUeqskaGEMsoKZ0I5NalIf7Qsy/iv+gnuqcmMky26s NTye3gCqGBfPMNKocHfwkpOjNG89fZAqmgetBwfa7qQl6fSG4GdjcxE88FBVK1/Km184 V2sZDVXWA5Dee3wZCXJhrJ0ZlqT5QMojlOGgcw2doeM2TazMY8pATAAPACTotEnQ9YIR m7O7rRVYVg6Y+hoytZiy9Ziuy003oMK+rxUyvxR5aIdn1xBrr4KXXmsfEmR128k6Vw8T 3yXw== 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=a4DOTBbYEKnT3EnjXiuFlp4qBusHe05Bi/ZftDfP8iI=; b=I1RhWJqP4YgrVU7W8q/xjqcCjr2z354SjIMpY6NbEQ3oKiWQ1THbAt7l9+fMabSZRJ OYB1TM62AKmPZLa1kLWO+NR/cGOuQQSbt9OysMe0BX0WopiwfVKr15rNUAMNhcVt8e5G VZC/4UzMCTcNMjNdbux+kHdgRaG4aAQzx/l607OvdjkIt+Inp1MfNiaKvmRRVbfgjL3G xX/IV0WMQcJUO+b4kIeA9M5psai3Hw0ZjWzOAgdaeeemfzwGeHUNQQjnBxlHr2eNAx7P 26Wi2ZaDhQGkOB/f3eBFOwQ1bJfGb3naKPtN3N/hnWBGWEhve2IMlkFIrNdHHIOZ4o9j E5fQ== X-Gm-Message-State: AOAM531OlOGTaTfUlQvYT+9m6Sbuc05tx/zlLTh6gHalUSdfXe17Kby0 YJkChWwqqusRdXNzgG1XisyliMuWVhWNfa6fXw/xKtNdiWk= X-Received: by 2002:a9d:2f29:: with SMTP id h38mr1039188otb.241.1618523418458; Thu, 15 Apr 2021 14:50:18 -0700 (PDT) MIME-Version: 1.0 References: <20210412222050.876100-1-seanjc@google.com> <20210412222050.876100-2-seanjc@google.com> In-Reply-To: <20210412222050.876100-2-seanjc@google.com> From: Jim Mattson Date: Thu, 15 Apr 2021 14:50:07 -0700 Message-ID: Subject: Re: [PATCH 1/3] KVM: Destroy I/O bus devices on unregister failure _after_ sync'ing SRCU To: Sean Christopherson Cc: Paolo Bonzini , kvm list , LKML , Hao Sun Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 12, 2021 at 3:21 PM Sean Christopherson wrote: > > If allocating a new instance of an I/O bus fails when unregistering a > device, wait to destroy the device until after all readers are guaranteed > to see the new null bus. Destroying devices before the bus is nullified > could lead to use-after-free since readers expect the devices on their > reference of the bus to remain valid. > > Fixes: f65886606c2d ("KVM: fix memory leak in kvm_io_bus_unregister_dev()") > Cc: stable@vger.kernel.org > Signed-off-by: Sean Christopherson Reviewed-by: Jim Mattson