Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2501252imd; Fri, 2 Nov 2018 12:32:12 -0700 (PDT) X-Google-Smtp-Source: AJdET5fIwwYx04unJWWZrsKk6HE58MEs1wHElS3wG5QWM0+JvRPDZRDHG5psgNeFx4NxhxdowXDb X-Received: by 2002:a17:902:f203:: with SMTP id gn3mr12270603plb.93.1541187132291; Fri, 02 Nov 2018 12:32:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541187132; cv=none; d=google.com; s=arc-20160816; b=p1zxsXTHVoMrypDzUqImtQmz4zfz6Nu+/m155/jzxkrtxn6C7cIJ7cWBdwWRThvRiS otZ+kqCUrhQaFc2ILCqqxYpcltYUIzy/NdYWxSQ3djOHXDkWfarUFkYbP/Yh02Q0uu1E 1lOExBx8+uTxDXKezDRbmFf+nACiCcNkC/seTLgEZbvdWy6c2iu5HXuW0nUD1v3DHhJK qKTFREg5BnEfnxYjC6u9KY5OuIubb/imfif+TIHW/C1Z+XL3LhJhO3n8m6P//aRUmdlR ww0JQZRXL99GtX92YGFT8XeBt+TqvtLtqqgDPSrZF1t4KASRolPTn7bjofCtaDXDM+zQ Pvyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=IlJ7Js4FnCaUqfAF1jGQAt9i057licATsE4kCOqOQTA=; b=A1kQvldOJTG7ePs98FnBEvDW9XZ7EDJ7eTNKz50R/hlGa2Ri5Qi5C1wGwinX4mEGhJ h633xluyMgpk2CAxdbEt9L0Qe4xPQdYu6wGAycE1wD7KI+383EQAwV6bQ8mCLXu3bQmc xcT73v0ZJgphIboDERUOXieTXwRWtTyN1kFHLMlgo5MnmOKBiZXtboyj+hTttS/dSjkp o+pc8SB74O2yxOB++f+bt9g9vE0TuVf3HVkVy3cqJr8Ry+TJb3VQkyLp3+1FhmJKsftf on/i5J1ByDayHhi6Ig3FVPWRh6To5ja2YHzAh+8RUDHYzt4Mz/4EsVyppt1mcoZ7CbPY /ICA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FNx22Z5Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b68-v6si23462019pfe.168.2018.11.02.12.31.56; Fri, 02 Nov 2018 12:32:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FNx22Z5Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728182AbeKCEjz (ORCPT + 99 others); Sat, 3 Nov 2018 00:39:55 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:52155 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726051AbeKCEjz (ORCPT ); Sat, 3 Nov 2018 00:39:55 -0400 Received: by mail-it1-f193.google.com with SMTP id h13so4684715itl.1 for ; Fri, 02 Nov 2018 12:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IlJ7Js4FnCaUqfAF1jGQAt9i057licATsE4kCOqOQTA=; b=FNx22Z5QOCVK1W6R1d215O7NpwQxjuqYqwJI3MaNOi0av/D4uJs5Om2FyLsH1ur1Qj 4co/Z+fEU/4UJXsIpOyz4DOUwinsjt3uwntMr71nGeUR8Ky805JAjRuPxuDw/myBLUuq mY086/gxuDGmWupl6N6SyZBBVu80oSLAKzC9b3jojhUHLmtduH12iRZj8MJMQy7lE5x5 Qx7tLzvkJIqN47xCj2Trx2uQzkHD6uDafmo1BAEEf6aoHqiYeSkPUSf98MYEExGtgBaX t6Om2TJHJNm+KZPbiAwrLcthzIKJZh2hWrjGbYW/cLPukwceVZ0psPj78Ad7KbZFXm4n 7PWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IlJ7Js4FnCaUqfAF1jGQAt9i057licATsE4kCOqOQTA=; b=eTELiZ4klSLbarJOTqGPcfjnsO0j9PDXP1pMijsEeS0EZtCgdhuIe2z52ZZGO7122K NAq8dD8DhtQz1MxqXE6dhInvu/uXOu2yXgMuSgRdsVCKbMatqnyotXTKhRuyeViql3L9 gnkItB+fX1OhSJT8Ebvxw4uVnDkFkkBP42bLuWbu+hC+9b830mM/uTafDZzLE1lylV7P 9Ie7vGgA6pqgZHdttYoPxxFUm8sHpE3T9AWAfi0MJusLUcNH7linXIHxE2iQ+0QqE4rx o6h+MX6FOkCsalJqd1dYyAKPNwLMJ7NCJR4fMlL2kOsVhPe0/B/Ncl/Zh8oYcImLAmvu 4bKw== X-Gm-Message-State: AGRZ1gJXkvl9b9GTai3rjYyIgr+oiEN/8JHwpbW1V/f+P9LtsMkvpziQ Z/ctuMMYJyawycBEcqGuqP2FMkoQy9/Mr9+btOLDYA== X-Received: by 2002:a02:1548:: with SMTP id j69-v6mr10825427jad.72.1541187088555; Fri, 02 Nov 2018 12:31:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:b01b:0:0:0:0:0 with HTTP; Fri, 2 Nov 2018 12:31:07 -0700 (PDT) In-Reply-To: References: <000000000000bc17b60571a60434@google.com> From: Dmitry Vyukov Date: Fri, 2 Nov 2018 20:31:07 +0100 Message-ID: Subject: Re: INFO: task hung in fuse_reverse_inval_entry To: Miklos Szeredi Cc: linux-fsdevel , LKML , syzkaller-bugs , syzbot Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2018 at 11:12 AM, Miklos Szeredi wrote: > On Thu, Jul 26, 2018 at 10:44 AM, Miklos Szeredi wrote: >> On Wed, Jul 25, 2018 at 11:12 AM, Dmitry Vyukov wrote: >>> On Tue, Jul 24, 2018 at 5:17 PM, Miklos Szeredi wrote: > >>> Maybe more waits in fuse need to be interruptible? E.g. request_wait_answer? >> >> That's an interesting aspect. Making request_wait_answer always be >> killable would help with the issue you raise (killing set of processes >> taking part in deadlock should resolve deadlock), but it breaks >> another aspect of the interface. >> >> Namely that userspace filesystems expect some serialization from >> kernel when performing operations. If we allow killing of a process >> in the middle of an fs operation, then that serialization is no longer >> there, which can break the server. >> >> One solution to that is to duplicate all locking in the server >> (libfuse normally), but it would not solve the issue for legacy >> libfuse or legacy non-libfuse servers. It would also be difficult to >> test. Also it doesn't solve the problem of killing the server, as >> that alone doesn't resolve the deadlock. > > Umm, we can actually do better. Duplicate all vfs locking in the > fuse kernel implementation: when killing a task that has an > outstanding request, return immediately (which results in releasing > the VFS level lock and hence the deadlock) but hold onto our own lock > until the reply from the userspace server comes back. > > Need to think about the details; this might not be easy to do this > properly. Notably memory management locks (page->lock, mmap_sem, > etc) are notoriously tricky. Hi Miklos, Any updates on this? syzbot recently found this hang in fuse, which looks real (totally unkillable): https://syzkaller.appspot.com/bug?id=0d08132d6dac82ae63b7b8d4a9d027d30b46167d but this one still happens, and it's hard to tell if it's real or not: https://syzkaller.appspot.com/bug?id=76f8203fef423375d230f14b8f5b45617ab945e2