Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1337283pxj; Fri, 21 May 2021 11:37:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2lkKU67SD/ZFmy3nAiHn80v/FPLCAgy80/iU8U9uSNnZZeUSThcnFRc6Tfu5wvnH9IuXi X-Received: by 2002:aa7:da8e:: with SMTP id q14mr12835367eds.13.1621622279715; Fri, 21 May 2021 11:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621622279; cv=none; d=google.com; s=arc-20160816; b=N/1xGTpskgAUn3q0dlNi/IFG24zUfEt6Zky20hHfx68S7buPBM25C4IpOJqVKJdRT+ gU2cI8bz8mvEqmKvL3jBOCmDYvCMsx1nIuTWjiHBtLey0bmrcNBZdkww5ROipSdXbmJb Bpn/aqWFtBt+8DvAEXZMsnpVATBaOyz9jZ35Xh5vGzVC3CmePu9lY8adCOKjdTQnIRsH C7KJa0BRsh9+U53vlMKRIFDC1NJzPPHUo+4uJfKeENOzaciTAFxGVBXrDoC8WnAmw6R2 7f+WuB4bVgX3vaaNrKR9SNQFzcvvolgbPOjbj+nbDP2nc9dbjTDExu3rW6HAkm16XXkI p4Uw== 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=yA7Lkm/nXDMCfmn4EBtAJW5GRrIK88MdQhqjgo97iYc=; b=h4qZSu/oHzc3eWY2ytCqreTDVKO+cE3TVRIvEgase9+Yb3L7X9HHYnDmPFMMWs0DVE Lf4NE/dTfEHLoY4vyOT4dQ0IqiqaHLhaQinpY4XGSTTq6wYgLfpt6eG9pAxW88a5Z19j cVg/VtfYl90zHApMnpWvzbjfR48gkGKmAz4v0ga8Hr6nfO5ei1mcVQJMZRpC7++POYW1 LFzI+kVKT4AOcYiqJJw8ApAKfyoVb77dTQrL4fw2odEpS9VEdz/ZTxT1b0vDzEF2spBl QClnUy4Zs5f6Bt9zkyr7UuzRAqsZiEogzqGFydxQvHFxIv38na1h2TCRb64Ymhe1On4b WoPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=C18mRKWi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si6869628edq.235.2021.05.21.11.37.35; Fri, 21 May 2021 11:37:59 -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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=C18mRKWi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231418AbhEUHz4 (ORCPT + 99 others); Fri, 21 May 2021 03:55:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231301AbhEUHzz (ORCPT ); Fri, 21 May 2021 03:55:55 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ABE3C061574 for ; Fri, 21 May 2021 00:54:31 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id q6so5698609vsp.13 for ; Fri, 21 May 2021 00:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yA7Lkm/nXDMCfmn4EBtAJW5GRrIK88MdQhqjgo97iYc=; b=C18mRKWikKVx1cic8io2JbRa79yx/52/8m0xFuj1FZsu7EuOsgMlp9RDIqjkJ+sDKC 1POBz/VL0Z4NxyJd14bYcBLpZn4v8THFtAPLJ+E2T4udz4+QjiUwEUyd9zjffvf160LC cDP3k4gS2MBFFOQBoNEmuTWqlLYwdQrXg1XDE= 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=yA7Lkm/nXDMCfmn4EBtAJW5GRrIK88MdQhqjgo97iYc=; b=PI+OZhj0aqc3cZyiImd83DaLxV50hhZtIUtgZf0D9TsdLBldvOJ9AQ/HExMhZTmtq1 7TdrDzZ4BgonyiQ/2rZhSUdXRfeTkM5hxTShHRozFW2sgOueTs1jo1f33q7O+gzlnhue tH5j6g/87eMY86mprTzUPmMrPUrUuSZRVM+bxhr2Cz0Ump1YQeNL3w00wPNyUR1BVPtx H141Wh1cDhEGPD5Sf2UO/LyjHTCQZ5QPVC8crBSgbkUhOwcRSy8fVeIscViBjl2KFjUj BYjVF76KClvc5K45tgNCzNZwQ7YHWCi/3riEzVc4LCLDtMbmg+fJ6IqVOAHe0/19FioJ 4WEg== X-Gm-Message-State: AOAM533LyM7KNBDSQNxUqeU5G1CjaHhbt+f/BFPmBHltvnDVsb+fGoQO uV5p8wNbULWXMTesd8bgV0af2bo4XRmAskobHpNBig== X-Received: by 2002:a05:6102:b06:: with SMTP id b6mr8147911vst.21.1621583670705; Fri, 21 May 2021 00:54:30 -0700 (PDT) MIME-Version: 1.0 References: <20210520154654.1791183-1-groug@kaod.org> <20210520154654.1791183-2-groug@kaod.org> In-Reply-To: From: Miklos Szeredi Date: Fri, 21 May 2021 09:54:19 +0200 Message-ID: Subject: Re: [PATCH v4 1/5] fuse: Fix leak in fuse_dentry_automount() error path To: Al Viro Cc: Greg Kurz , virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, virtio-fs-list , Stefan Hajnoczi , Max Reitz , Vivek Goyal Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 May 2021 at 21:45, Al Viro wrote: > > On Thu, May 20, 2021 at 05:46:50PM +0200, Greg Kurz wrote: > > Some rollback was forgotten during the addition of crossmounts. > > Have you actually tested that? Because I strongly suspect that > by that point the ownership of fc and fm is with sb and those > should be taken care of by deactivate_locked_super(). Not quite. Patch looks correct because destruction of fm is done in fuse_put_super(), which only gets called if the sb initialization gets as far as setting up sb->s_root, which only happens after the successful fuse_fill_super_submount() call in this case. Doing the destruction from the various ->kill_sb() instances instead of from ->put_super() would also fix this, but I'm not quite sure that that would be any cleaner. Thanks, Miklos