From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69F97C282C0 for ; Wed, 23 Jan 2019 09:45:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3088E20861 for ; Wed, 23 Jan 2019 09:45:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="qe0dhxSn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727142AbfAWJpT (ORCPT ); Wed, 23 Jan 2019 04:45:19 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:35928 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726291AbfAWJpT (ORCPT ); Wed, 23 Jan 2019 04:45:19 -0500 Received: by mail-it1-f196.google.com with SMTP id c9so2102390itj.1 for ; Wed, 23 Jan 2019 01:45:19 -0800 (PST) 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=IWnnXB5A16StXqrw7pQ/XIlCHAKKzD9bl7SkOn/Wqxo=; b=qe0dhxSn+A5wN8Mbnraqq3MmW6tlbBVr+j/TSZ3QtyLu8w2tLvbcGXhdQaL57LHics tBspmqtm5xlBGENcSZlYW6zbYg5qzHRjKPLrwQBg8PQE4/COlueLWXqy/QVQqSpxvpUa H3Rcm1BHJPehlhElFXoiwUOad5dnUv8OuQ0pE= 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=IWnnXB5A16StXqrw7pQ/XIlCHAKKzD9bl7SkOn/Wqxo=; b=Tmsqovkey3dNSyeWsHxUSvUllgqvDnM332Yr08K/EVDhpQAsJOtq4lpcn3SVTMoE+T JKdXdr7kB7izbuZ5+X3dLU20vATMLTcduJuvRRyr1CslDeJx69jOqaR9I5dZ+b9sqvov TfiTUJb2H/fR/NWtbLl7z7lqllEx+6ldwLzZXEUwfBNPupwFBjYwln3O/oJZ+Idu29O0 ZeGvmomEphhHppBj4GcNRgXcSszFvA6ANmDyL5tJyiMyQgQk81LxNoZt39QSLA4WRPtD Sql/h/squNSJ1iQdzGLvxVfS3G2mPaghr9JCn6xNksFp21EJZJF/CW8hBAItznS/KgZN X5Kw== X-Gm-Message-State: AJcUukeKBcB1TUW60vr46BZndBvcyJ7iIVf6LwZfPSiYzw5EodfSCopv xO3eAgFQpcmavRoa5e2NetV3UVLe3UZe5vpJJcxZ08EY X-Google-Smtp-Source: AHgI3IaxrIPWcVm/ecBW+28dJcbH/MGebVUaoh3aimsnsURrveAGCbai9NQZzUbnQMwwykpNuKRysXWf90+W5H0f2DM= X-Received: by 2002:a24:a08a:: with SMTP id o132mr1222060ite.1.1548236718699; Wed, 23 Jan 2019 01:45:18 -0800 (PST) MIME-Version: 1.0 References: <154754701031.4244.8089449938935364463.stgit@localhost.localdomain> <154754755979.4244.14965151684224631403.stgit@localhost.localdomain> <98ae21a4-fb96-c06e-e442-5929d36f2bf3@virtuozzo.com> In-Reply-To: <98ae21a4-fb96-c06e-e442-5929d36f2bf3@virtuozzo.com> From: Miklos Szeredi Date: Wed, 23 Jan 2019 10:45:07 +0100 Message-ID: Subject: Re: [PATCH 1/7] fuse: Check for fc->connected in fuse_dev_alloc() To: Kirill Tkhai Cc: linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Jan 18, 2019 at 1:28 PM Kirill Tkhai wrote: > > On 18.01.2019 15:07, Miklos Szeredi wrote: > > On Tue, Jan 15, 2019 at 11:19 AM Kirill Tkhai wrote: > >> > >> fuse_dev_alloc() may be called after fc->connected > >> is dropped (from ioctl), so here we add sanity check > >> for that case. > > > > AFAICS this is not fixing a bug; i.e. even if the fuse_dev is added to > > the fuse_conn's list after disconnection there would be no leak. > > > > In other words, it's irrelevant whether the connection reset comes > > just before the ioctl completes or just after. Or am I missing > > something? > > Yeah, there won't be a leak. The only problem I see, userspace daemon > may become waiting in fuse_dev_do_read() after abort is finished. By that time fiq->connected will be reset, so fuse_dev_do_read() will return ENODEV/ECONNABORTED. Am I missing something? Thanks, Miklos