From nobody Mon Feb 9 14:50:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1630791459; cv=none; d=zohomail.com; s=zohoarc; b=MITb0fPkv6btrLGBRIDZs2e6tWRlCyDR697DIjSzLM47RaaiEjFBnY6WihKd9upAbitAb/ypVzsm5/d+Qf5tlfmQIUB0nYcrqOm+U8pHse10pbCZVAYkm3UgyF8dUnbYCdVOFiuNT22/uW7nA/UAQR4aOrioe0sRxySSP8ieC+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630791459; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=doYK/spK0f25lGEJlA5QHUXT/MrGzKE697ZoiH7sqDc=; b=Zo5leYBpfFn+mxzDUOaqsv4mK/7Rbuu20ic4xzDfV17fNTBIljUojtgORBFrX9vRTXFBIh61/78unjD0stvf6JzAmr+VN0Q92FLSAwO4yH1ymGCP2uwiMojKmg8Bxe93gYyu+33oROANXELYgX0ObVDwgH9ckihcYrr24QCSjhQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630791459407336.06369349872614; Sat, 4 Sep 2021 14:37:39 -0700 (PDT) Received: from localhost ([::1]:34238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMdM2-0006EF-9L for importer@patchew.org; Sat, 04 Sep 2021 17:37:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKY-0003TM-Rx for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31098) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMdKX-0000jS-CS for qemu-devel@nongnu.org; Sat, 04 Sep 2021 17:36:06 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-lfBFxvypPpqu9Oqn905APg-1; Sat, 04 Sep 2021 17:36:03 -0400 Received: by mail-ej1-f69.google.com with SMTP id v19-20020a170906b013b02905b2f1bbf8f3so865101ejy.6 for ; Sat, 04 Sep 2021 14:36:03 -0700 (PDT) Received: from redhat.com ([2.55.150.176]) by smtp.gmail.com with ESMTPSA id n13sm1523782ejk.97.2021.09.04.14.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 14:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630791364; 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=doYK/spK0f25lGEJlA5QHUXT/MrGzKE697ZoiH7sqDc=; b=gLn+XnLCeT737OzuOCAQlL7ld2pDhpBc/0mi3Ez6kl5k4NlMer8asvXVzLio6zG7DvTAkm A+JQD6iHyFzFI0akbJGdBYZmuxMIf/ySuIS4kgoOjSal7hUCV+AAiEAQeC6DjYg2tyHvNU rAQfI45kSSS54+jN8L8R/j4b2BVx76I= X-MC-Unique: lfBFxvypPpqu9Oqn905APg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=doYK/spK0f25lGEJlA5QHUXT/MrGzKE697ZoiH7sqDc=; b=mkk/ClPfwuYWoimLzSrlILUnAxAPT8ePuEFABI5KmlsyAOgmdu9Gtgrjys9LQ/o5J6 hD1UgrjkICkHTfXa4xV5NG6WEk+YAV2G2fMKoxKBgKNBz7L9OYYzX6vzWfWnaP4haMp5 UVFE8aTTWop/thZ0+PsaCjEFao3QFEida1sysaY5lx6eoHEFFdvCvASiD3NNRiuP9Ag5 uA8OD8M9hpA4hu/Aiuy6snE3kQjffAOXX6RW3cUrZlQuoobu70MiST15xiu6b2OUTs5G OXDzbG3cD1Xd6S91QzBr/N4BISwEbTrlAca4ackjckPjf4fBhDl/vM5/mseYxOruzRev Fa5w== X-Gm-Message-State: AOAM533DRUek9ofZvhZUBuDup1wnvvyR0xyRATuALQUhdtVFCpLaqf9J aGulV8hIO1UUCobhoxq5lG8hDFB/eAdLzNv56YH4W+U74vtsC7hVepsZDKSnxYF0E/YGbNC8Urc hBynZNl1K9bT0cc5G20TFClPLslsRp5/V3u930N73Bk2xGg7yedKn392Gw0Dx X-Received: by 2002:a17:906:b18e:: with SMTP id w14mr6044199ejy.63.1630791362204; Sat, 04 Sep 2021 14:36:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjqnl++0IXqB1wzzTGxb/qs0Wa02rtRPPHZvBmEqvfUOhJYnQlcf/7pS15pXjtSKCkMU1ffQ== X-Received: by 2002:a17:906:b18e:: with SMTP id w14mr6044181ejy.63.1630791361939; Sat, 04 Sep 2021 14:36:01 -0700 (PDT) Date: Sat, 4 Sep 2021 17:35:59 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 02/35] hw/virtio: Fix leak of host-notifier memory-region Message-ID: <20210904213506.486886-3-mst@redhat.com> References: <20210904213506.486886-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210904213506.486886-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Yajun Wu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630791460821100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yajun Wu If call virtio_queue_set_host_notifier_mr fails, should free host-notifier memory-region. Fixes: 44866521bd ("vhost-user: support registering external host notifiers= ") Signed-off-by: Yajun Wu Message-Id: <1629077555-19907-1-git-send-email-yajunw@nvidia.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 2407836fac..33002300c2 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1474,6 +1474,7 @@ static int vhost_user_slave_handle_vring_host_notifie= r(struct vhost_dev *dev, g_free(name); =20 if (virtio_queue_set_host_notifier_mr(vdev, queue_idx, &n->mr, true)) { + object_unparent(OBJECT(&n->mr)); munmap(addr, page_size); return -1; } --=20 MST