Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp640475rdb; Fri, 8 Sep 2023 11:22:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9nTqWpi928u5Tk+NSjJNPPN4cB6L2yRn/ua3Zu9EQ8Dne9eWFwa5uZ1UcG8Hut0qYnwAi X-Received: by 2002:a17:906:9713:b0:9a1:fab3:ee43 with SMTP id k19-20020a170906971300b009a1fab3ee43mr2482067ejx.0.1694197334836; Fri, 08 Sep 2023 11:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694197334; cv=none; d=google.com; s=arc-20160816; b=lpRdwXqr2v8fZsIoLWb50ja9rtyaaPxHp1gUITfxxX0+dXRX8Jx/R44fhF+LoMIxiG lwi1JdDjeNFMLQ05rN+9s82BVrcz75kAV3v6NW0wBpBit9y4k36/c7xc5RAOUfHGc8ZT cSDN9QQj/FuyQKLXBrOrKHZsOcF9d76uhz1i9RdgE7g4mPmQBJEJK6v/FXVSMEgKn056 UMC25ziWVBl7oHpnVxaEr1GYDwoINYvGDQ3FTrbb5eByDoD5UCxfzYv7A0aIh8rPrqEC IpFYe/xQmHNJxWXZ8x1MhqM8I9q3lHZYG1fvHmOENIxn+EcJoARPLf13GgdZ4oMjl6vK ItfA== 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; bh=kPFBUUHSf2+KtEm/t1xv0CmpZL8PE2rostV1bDW7QW0=; fh=bmlx4mBq1pHyWrMvP3ecJ041fEiSw6iakAwuDFlucNA=; b=B9W2Wi2PuwxwzfauAVcYqx0NW/oMAZkLK3j7RoSlFC/uXVUJkjrRaGVV4+W//m1WHp D/FyoxRnwGfuAma1z6Rp9LBkBJ8q/Q2HmtcwIhIkw9CRl3rGvzD+rU1v2sySp0yejYtO AKy5Xfz8BwglNJsxj4jDyq2tRs1DtSiNYzz9RJw/kf2l9iahgh0rQl6/M835dIHIjr+2 v0+ENv4rbtV575KKzGPpwz8uRGK95zBvrAhN0Vqhm/nzEwIcY+A+makQPPct0NNrJ6z0 Cie/CA3AfaIE2Jcjlfr7p8Bu1cxzeGaStIASK+SKXu/DJ23EILNirlsKyRqOqH3aSPvk EZiw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a1709062dc100b009a586694dabsi1705981eji.950.2023.09.08.11.21.48; Fri, 08 Sep 2023 11:22:14 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244724AbjIHPlV (ORCPT + 99 others); Fri, 8 Sep 2023 11:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239384AbjIHPlS (ORCPT ); Fri, 8 Sep 2023 11:41:18 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 781EC1BC1; Fri, 8 Sep 2023 08:41:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95ADDC433CB; Fri, 8 Sep 2023 15:41:12 +0000 (UTC) Date: Fri, 8 Sep 2023 16:41:10 +0100 From: Catalin Marinas To: Maximilian Heyne Cc: virtualization@lists.linux-foundation.org, stable@vger.kernel.org, "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Wolfram Sang , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] virtio-mmio: fix memory leak of vm_dev Message-ID: References: <20230907141716.88863-1-mheyne@amazon.de> <20230908113840.GA19696@dev-dsk-mheyne-1b-c1362c4d.eu-west-1.amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230908113840.GA19696@dev-dsk-mheyne-1b-c1362c4d.eu-west-1.amazon.com> X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS 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 Fri, Sep 08, 2023 at 11:38:40AM +0000, Maximilian Heyne wrote: > On Thu, Sep 07, 2023 at 05:28:25PM +0100, Catalin Marinas wrote: > > On Thu, Sep 07, 2023 at 02:17:16PM +0000, Maximilian Heyne wrote: > > > With the recent removal of vm_dev from devres its memory is only freed > > > via the callback virtio_mmio_release_dev. However, this only takes > > > effect after device_add is called by register_virtio_device. Until then > > > it's an unmanaged resource and must be explicitly freed on error exit. > > > > > > This bug was discovered and resolved using Coverity Static Analysis > > > Security Testing (SAST) by Synopsys, Inc. > > > > > > Cc: > > > Fixes: 55c91fedd03d ("virtio-mmio: don't break lifecycle of vm_dev") > > > Signed-off-by: Maximilian Heyne > > > > Reviewed-by: Catalin Marinas > > Tested-by: Catalin Marinas > > Who would apply this patch? The virtio maintainers (Michael, Jason). > Something seems to have choked my patch so it didn't > reach lore.kernel.org (message couldn't be delivered due to timeout). Should I > try to send it again? You can send a v3 with the added acks. It's strange that it didn't make it to lore. I got it as I was cc'ed but checking the archives, it's not there. -- Catalin