Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5751966imm; Mon, 23 Jul 2018 05:34:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd+nWh1b8q44ES0tXSpdGLIbWEBFKlz+xVrbgY4r/rkLU7pM78mIlUf4/7FjoJ3AAsUYf+k X-Received: by 2002:a63:1c13:: with SMTP id c19-v6mr12165393pgc.332.1532349292217; Mon, 23 Jul 2018 05:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532349292; cv=none; d=google.com; s=arc-20160816; b=bd43I/O9jLrh4Lsh5vSeQk6ZwghuHLwteCkOKvOzzAuFMJ/TWJ5AM3ciXrPwKHvhXB uhnx57e+Bg/c8CqDrKqwwKFxKI5GGV0Ff++jCmp6cA8soM0KP4KptD/C33rK5w+11jHx FmVWpcm/GVMRZVMhHY9dfzSIFMJP19YEiCmnAuu0p+VINcITVpGMJ5nfR5hCa77r0GMu y42W2aM/GLN5l4K/7FxfBCNPoYWVjKNVlqXObGY2gnKeAWyD+cfsIWEit2UAj3CGT+Hj T9KjWRPHftN7DPdCFc3KMETtZcmc7dDgq8w1ZBJ/5CuoQcM8KS+Epqgn22PTtjQI1KY3 bUZg== 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 :arc-authentication-results; bh=YxlAy4AVdefMtO4348qcH8D7Xq5kPHwrbqPswzbOznE=; b=wP9eNAd9TRAkGbrG3rYr5xNFIfLliyMEKKu7Awu2RDfUTQJPxnlqceLdk3MmF9ogUw u83demS9af+69bypvvJLM9VP0LG/f34RIxu4swgK5yRIiUos3NpuUqXR/cGViz5qQ8MD KOASQleUSoxt5/Wa0n9r31Qm59fsnlpqLMdSj2MhXNlYMe4yy3Za6xSIm04+dBQyRMgX qt2NwnR77NImA42RMSbUGAwKImxuPU6Sqs5CuAyPl+IQkUjX/Xz7kZLnz5bT+fWKazr1 J2LCi3J0R3hzY/LtJDhSUOJ/2+tKHAjQM10GYL+JZHxLYavZaPfPZW+aGTtyfDFAPCk1 Z2Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=kiFtOrw3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4-v6si8585936pfd.344.2018.07.23.05.34.37; Mon, 23 Jul 2018 05:34:52 -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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=kiFtOrw3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388731AbeGWNeJ (ORCPT + 99 others); Mon, 23 Jul 2018 09:34:09 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:34917 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387956AbeGWNeJ (ORCPT ); Mon, 23 Jul 2018 09:34:09 -0400 Received: by mail-oi0-f65.google.com with SMTP id i12-v6so792941oik.2 for ; Mon, 23 Jul 2018 05:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YxlAy4AVdefMtO4348qcH8D7Xq5kPHwrbqPswzbOznE=; b=kiFtOrw3wiyTG1K09IWZ+YUPHSJZHPVcweHu2R0jDTugrKpSGwi1s4lz3jDLag8haj Fy8N2IdSWNYepw6S5mCUqGqgdO2rFk9rCOpihyl5GwinS3sy2K6hotIcIzZabbY/kJ2y ets/jnPOrevs1XXFLx2nknBE7EY8+a/nfkDQE= 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=YxlAy4AVdefMtO4348qcH8D7Xq5kPHwrbqPswzbOznE=; b=CcUKX0MqMBqCE/BjNfLZ8pqMxC/xjhY2RCqefESQX/q1p3nEacUMlPbRwZ/nQb8gz5 JL73CO6DXe112eDdHIVwhl3k+6HlDbcz2CFa2+iyIsdTF74NVgDWsDard007V9H7c1bF p+wmp8FL9vAKDrhh89Ae3Fv4Vo20FWh8D+DsbbpK4vWZ2eFYT4BMSy3R+N9ul7bW+JZs f8lrHWLT521cIN/Z2+abcw1zPoNJ3NX58jG7wAKLNGLuGiuhCIW9ngZBMekOLTAqgHmQ N5/GMo3/KnslzNaM8PkLBlQnsrvPPZwOppAM+GQBt/BxfOhaB90zjNesdtQDTtBr9PZA B77Q== X-Gm-Message-State: AOUpUlF6yPtMh4CrM7IpwtGQKOoTM0EH8yMTrdB2994F/cSyMJlQrIj0 xBnu6tVgZjwZV9ATarz20y1BUz0JBQXYcjmSWmGBBw== X-Received: by 2002:aca:c257:: with SMTP id s84-v6mr8917431oif.104.1532349189253; Mon, 23 Jul 2018 05:33:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:113c:0:0:0:0:0 with HTTP; Mon, 23 Jul 2018 05:33:08 -0700 (PDT) X-Originating-IP: [212.96.48.140] In-Reply-To: References: <000000000000bc17b60571a60434@google.com> From: Miklos Szeredi Date: Mon, 23 Jul 2018 14:33:08 +0200 Message-ID: Subject: Re: INFO: task hung in fuse_reverse_inval_entry To: Dmitry Vyukov 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 Mon, Jul 23, 2018 at 2:22 PM, Dmitry Vyukov wrote: > On Mon, Jul 23, 2018 at 2:12 PM, Miklos Szeredi wrote: >> On Mon, Jul 23, 2018 at 10:11 AM, Dmitry Vyukov wrote: >>> On Mon, Jul 23, 2018 at 9:59 AM, syzbot >>> wrote: >>>> Hello, >>>> >>>> syzbot found the following crash on: >>>> >>>> HEAD commit: d72e90f33aa4 Linux 4.18-rc6 >>>> git tree: upstream >>>> console output: https://syzkaller.appspot.com/x/log.txt?x=1324f794400000 >>>> kernel config: https://syzkaller.appspot.com/x/.config?x=68af3495408deac5 >>>> dashboard link: https://syzkaller.appspot.com/bug?extid=bb6d800770577a083f8c >>>> compiler: gcc (GCC) 8.0.1 20180413 (experimental) >>>> syzkaller repro:https://syzkaller.appspot.com/x/repro.syz?x=11564d1c400000 >>>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16fc570c400000 >>> >>> >>> Hi fuse maintainers, >>> >>> We are seeing a bunch of such deadlocks in fuse on syzbot. As far as I >>> understand this is mostly working-as-intended (parts about deadlocks >>> in Documentation/filesystems/fuse.txt). The intended way to resolve >>> this is aborting connections via fusectl, right? >> >> Yes. Alternative is with "umount -f". >> >>> The doc says "Under >>> the fuse control filesystem each connection has a directory named by a >>> unique number". The question is: if I start a process and this process >>> can mount fuse, how do I kill it? I mean: totally and certainly get >>> rid of it right away? How do I find these unique numbers for the >>> mounts it created? >> >> It is the device number found in st_dev for the mount. Other than >> doing stat(2) it is possible to find out the device number by reading >> /proc/$PID/mountinfo (third field). > > Thanks. I will try to figure out fusectl connection numbers and see if > it's possible to integrate aborting into syzkaller. > >>> Taking into account that there is usually no >>> operator attached to each server, I wonder if kernel could somehow >>> auto-abort fuse on kill? >> >> Depends on what the fuse server is sleeping on. If it's trying to >> acquire an inode lock (e.g. unlink(2)), which is classical way to >> deadlock a fuse filesystem, then it will go into an uninterruptible >> sleep. There's no way in which that process can be killed except to >> force a release of the offending lock, which can only be done by >> aborting the request that is being performed while holding that lock. > > I understand that it is not killed today, but I am asking if we can > make it killable. It's all code that we can change, and if a human > operator can do it, it can be done pure programmatically on kill too, > right? Hmm, you mean if a process is in an uninterruptible sleep trying to acquire a lock on a fuse filesystem and is killed, then the fuse filesystem should be aborted? Even if we'd manage to implement that, it's a large backward incompatibility risk. I don't argue that it can be done, but I would definitely argue *if* it should be done. Thanks, Miklos