From patchwork Fri Apr 6 15:59:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10327205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2576A60545 for ; Fri, 6 Apr 2018 15:59:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 145EF295A8 for ; Fri, 6 Apr 2018 15:59:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 091ED295AA; Fri, 6 Apr 2018 15:59:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E90B295A8 for ; Fri, 6 Apr 2018 15:59:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751711AbeDFP7J (ORCPT ); Fri, 6 Apr 2018 11:59:09 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:45632 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751579AbeDFP7I (ORCPT ); Fri, 6 Apr 2018 11:59:08 -0400 Received: by mail-pf0-f193.google.com with SMTP id l27so1040419pfk.12 for ; Fri, 06 Apr 2018 08:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7o7E+knm70PRdHWYDXpov1xAe8jw97K4+Z6qtYV0HOw=; b=CuOeIFTDOya9X10kYfTocLsmXff5tbcYE54HsSMf36oSLrSQhlldikDKtWA2Er49gZ XIPPPBQZR74WU1IqGnQXjhxh7Rwb3pgQMdyao7A2/aPqyAKk+aBPlEO+UeeZ2e2ap+c7 oTIKz3z5oPO/Er4b5hJn/8lxJHC+TXpKQlDTeJfpitnvq9winDF7fjVuxEUkmF8LwBYQ vkRgUkKFnbRU/e4hQ10n/q0cLhVEintrft6cJwGvsraeuXk5HUx2LkFA1LiSpOnJCzg4 36WXkjEI8yKsr9qal+GN0BFpesc3RSYaMETS/u9Kfym56WtkIto4x6DQnuxsTOACvLSp Ds8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7o7E+knm70PRdHWYDXpov1xAe8jw97K4+Z6qtYV0HOw=; b=bGCBMNdA3K81v5wQjzYlaqyH5KO+JHrwJZC7htdSZz0RSiLVBl/wOn/s53wK9Q8uOu CQ0GOXE8mVzEg5/McnsQIstkCxOh8mmO1WBJW/Ftzxha27+YhpAe4y7wSSrWaFwlIbXZ 1SsnoliZW8Reu293bh5K+gS68LagrnKOxLb8mvRT2M8yhvY1LT2a3qn7CDc89pNbilKY Kpkgf5OrElFrEU23eLzN7oOOK+vs6NSlDVum8HOAWBkruDDZf1Ied+fHeU7FSQjmfBB/ QUcZSYXddGlE/IU0m6F6QTgwp+efSyZBgA20eUGpEDJVSONDQyBvjbQCmX64iqqY9lHP BaaA== X-Gm-Message-State: AElRT7GArqdpVTFYP3jqiY3YIO2sFezDSgT3mZFSx0G8jeE3ZPioYMVk gmS4uWdx74+LtsojKAGC/MZr1Q== X-Google-Smtp-Source: AIpwx49YIdnNfgYYmAjKK7B2thpMWN32ZOJWc+QvXC4nX4m0ihOoc23k3WiBsgcvbHa3uuAnjaZ61g== X-Received: by 10.101.76.10 with SMTP id u10mr18443094pgq.445.1523030347476; Fri, 06 Apr 2018 08:59:07 -0700 (PDT) Received: from vader ([2601:602:8801:8110:e6a7:a0ff:fe0b:c9a8]) by smtp.gmail.com with ESMTPSA id w12sm20596457pfi.180.2018.04.06.08.59.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Apr 2018 08:59:06 -0700 (PDT) Date: Fri, 6 Apr 2018 08:59:05 -0700 From: Omar Sandoval To: Peter Zijlstra Cc: Tetsuo Handa , viro@zeniv.linux.org.uk, osandov@fb.com, dvyukov@google.com, bot+abdba5bc6de135d7622f00756da97998425b6de5@syzkaller.appspotmail.com, axboe@kernel.dk, tom.leiming@gmail.com, hare@suse.de, shli@fb.com, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, mingo@redhat.com, linux-fsdevel@vger.kernel.org, knikanth@suse.de Subject: Re: INFO: task hung in lo_ioctl Message-ID: <20180406155905.GA11697@vader> References: <94eb2c0810d04f5a46055ffc71aa@google.com> <6012a726-069a-13a5-9c8d-6a11730d8414@I-love.SAKURA.ne.jp> <468f7418-a02d-79cc-3d94-91bbe146567e@I-love.SAKURA.ne.jp> <20180406121411.GJ4082@hirez.programming.kicks-ass.net> <201804062255.HEJ82361.FJOFHVtSLOMOQF@I-love.SAKURA.ne.jp> <20180406154343.GK4082@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180406154343.GK4082@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Apr 06, 2018 at 05:43:43PM +0200, Peter Zijlstra wrote: > On Fri, Apr 06, 2018 at 10:55:03PM +0900, Tetsuo Handa wrote: > > Peter Zijlstra wrote: > > > On Fri, Apr 06, 2018 at 09:04:18PM +0900, Tetsuo Handa wrote: > > > > + /* Temporary hack for handling lock imbalance. */ > > > > + if (__mutex_owner(&lo->lo_ctl_mutex) == current) > > > > + mutex_unlock(&lo->lo_ctl_mutex); > > > > > > ARGGH.. you didn't read the comment we put on that? > > > > > > > Commit 5b52330bbfe63b33 ("audit: fix auditd/kernel connection state tracking") > > is using __mutex_owner(). ;-) > > That got removed and the warning added. Seems easy enough to fix without resorting to __mutex_owner() (untested): I'll test it and send it up when I get into the office. diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 264abaaff662..cee258d12a1e 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1300,12 +1300,13 @@ loop_get_status_old(struct loop_device *lo, struct loop_info __user *arg) { static int loop_get_status64(struct loop_device *lo, struct loop_info64 __user *arg) { struct loop_info64 info64; - int err = 0; + int err; - if (!arg) - err = -EINVAL; - if (!err) - err = loop_get_status(lo, &info64); + if (!arg) { + mutex_unlock(&lo->lo_ctl_mutex); + return -EINVAL; + } + err = loop_get_status(lo, &info64); if (!err && copy_to_user(arg, &info64, sizeof(info64))) err = -EFAULT;