Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2159499ybf; Mon, 2 Mar 2020 03:12:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzQWTi0tnABOFD4c6raotGqMAU5uB+TgUfSKJEgVFCjJhvihTdPIuZJk88VUxxBtxJG2Ebd X-Received: by 2002:aca:fd94:: with SMTP id b142mr10715550oii.11.1583147527810; Mon, 02 Mar 2020 03:12:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583147527; cv=none; d=google.com; s=arc-20160816; b=BLac3OoUxL0na1YqfXKfjCLzpF9FHYaguU5f7GQ8563+6fxbLcFQ7wlXqfUdvimQuR vg3jX6pc+WDYU2764G79rDwFEP3iZyEJdP6uBV2KvxsH0mTR3YfanJc/uEArNkQh5twi tR/RPNu2JqGBzzDfrU6hvJlbJSeUhyqBAuD21WFSgurYF44aztyxDDNcGYzoLtG+RqyS RtMklqZPbtArQMp9KV1Uk8oY8YS14parBgKLx2x3l/wvs4CoCps7FSDFrbhw444F5+yJ 0KEfyd+2CteCRmBYzNpFrzmiegJksmcpUjIsDoX3Bm7MCP9o+zsmykZV8diKc/+Tj2P1 KyXA== 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 :in-reply-to:references:mime-version:dkim-signature; bh=JhiTjN0sACMySdn78HZVXBgamsKxhlPehaOxgnQ+L7Q=; b=I1uuBTMKpTOM/mZ6mDvZF2Mwdzww/o2Z0M18rLueMENtpTHHL6n7KbGXtkIAvt08rp navWwZfyJmfHDLGA9QL+miBxkDtmCuPqbp+BD+ZGqQEmG4WWM1HwZ93PN3sgZa7+aA/k 2EYc78GE1kGR751Lh78T4uyUZXEGv0iMRGwW1aOMMOH1EqPl/oIlUG4DSwcI5Cp76JbX VOoIvqmEYDoDgMKjovXdfdKCtwOa/CLyFPWVM4wN8DbSwN9FfCjFblYRRMiQSUOOLEbR Em8pRa/g8nHojTnhP1xLkYyZ2RPTs71hK74PYNj3eKpcv5Si6/gxLvKdVL8MhWiLGmou AN9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pPzJCl6w; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h25si2712101oie.192.2020.03.02.03.11.55; Mon, 02 Mar 2020 03:12:07 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=pPzJCl6w; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727032AbgCBLK7 (ORCPT + 99 others); Mon, 2 Mar 2020 06:10:59 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:33507 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbgCBLK7 (ORCPT ); Mon, 2 Mar 2020 06:10:59 -0500 Received: by mail-io1-f68.google.com with SMTP id r15so2417432iog.0; Mon, 02 Mar 2020 03:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JhiTjN0sACMySdn78HZVXBgamsKxhlPehaOxgnQ+L7Q=; b=pPzJCl6wVC5Zl4M2LfkBEgulsd8mEv3CvMmybE8h+4hsbw6I1OayQsoJxvLQy/iSlJ kllbqLB+tJhcJ1pwltLmSm0Eu5OirH6VbpC0mizrMSsCuum2z1+vQNA0/eDIJruoHweN SbEKHJ9ZCqFyouluqyNcDQL6jZB5s5sb9G2XjevhW2Becv88LLMUp7ahKiAfItuKYaDY P9dhLlqqocvavBjHoIfVYiadHfPacmI0fJ0K2p7K/GFunEiWXB1YPygaMUd+dHOV0/Rq fjixuSpyrrrETI0bmiN20rkSeoyk3ilta6vQvX8s09cNc+j2L6LndGWcrdCpE+hve0ya OKBA== 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=JhiTjN0sACMySdn78HZVXBgamsKxhlPehaOxgnQ+L7Q=; b=j6S+EFYH1XQOHdvLSO3d5z+OBZcCEWkAexGfEoPs/KZpuXEVUM/XWw99sNYzPMYgQI HiCHAIIfiCliXSgkDWhJPkbXitvhE8S0ANmON2s4KmXBynQ+kMuItCysMeHgEGVNebGY w1raWxfm0EjtUNR2/Dk/ewEN2QguxQyok34ChyZZ59rNylV6nDlNzHDABKdrOZ4KLIz3 AGB5G5VX8nDXq7XXJUbpDYaGWIkxf+PB8Uc7QCkHQDW0tEo4/wg8jEOis636OgupviAd QKc+4VMFs6CrZCNF/OQwQqoHjBhDQHuWAzD3wn6MOeMwA8H07gJfpGFOS/TEFmr39Guu /uXQ== X-Gm-Message-State: APjAAAU76zYin7Arfp+VVAWX0lOv0bZ7B5jflzBIGtNyehQQmWp9bOA+ tEyZeAHyo85WlW2hMVuLUcoxlwcObxAXE6oyr0Jm581x X-Received: by 2002:a02:7656:: with SMTP id z83mr13409880jab.81.1583147458564; Mon, 02 Mar 2020 03:10:58 -0800 (PST) MIME-Version: 1.0 References: <000000000000d3e319059fcfdc98@google.com> In-Reply-To: <000000000000d3e319059fcfdc98@google.com> From: Amir Goldstein Date: Mon, 2 Mar 2020 13:10:47 +0200 Message-ID: Subject: Re: WARNING: bad unlock balance in ovl_llseek To: syzbot , Dmitry Vyukov Cc: linux-kernel , overlayfs , Miklos Szeredi , Miklos Szeredi , syzkaller-bugs 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 Sun, Mar 1, 2020 at 9:13 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit: f8788d86 Linux 5.6-rc3 > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=13c5f8f9e00000 > kernel config: https://syzkaller.appspot.com/x/.config?x=5d2e033af114153f > dashboard link: https://syzkaller.appspot.com/bug?extid=66a9752fa927f745385e > compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81) > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=131d9a81e00000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14117a81e00000 > Dmitry, There is something strange about the C repro. It passes an invalid address for the first arg of mount syscall: syscall(__NR_mount, 0x400000ul, 0x20000000ul, 0x20000080ul, 0ul, 0x20000100ul); With this address mount syscall returns -EFAULT on my system. I fixed this manually, but repro did not trigger the reported bug on my system. > The bug was bisected to: > > commit b1f9d3858f724ed45b279b689fb5b400d91352e3 > Author: Amir Goldstein > Date: Sat Dec 21 09:42:29 2019 +0000 > > ovl: use ovl_inode_lock in ovl_llseek() > > bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=16ff3bede00000 > final crash: https://syzkaller.appspot.com/x/report.txt?x=15ff3bede00000 > console output: https://syzkaller.appspot.com/x/log.txt?x=11ff3bede00000 > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > Reported-by: syzbot+66a9752fa927f745385e@syzkaller.appspotmail.com > Fixes: b1f9d3858f72 ("ovl: use ovl_inode_lock in ovl_llseek()") > > ===================================== > WARNING: bad unlock balance detected! > 5.6.0-rc3-syzkaller #0 Not tainted > ------------------------------------- > syz-executor194/8947 is trying to release lock (&ovl_i_lock_key[depth]) at: > [] ovl_inode_unlock fs/overlayfs/overlayfs.h:328 [inline] > [] ovl_llseek+0x215/0x2c0 fs/overlayfs/file.c:193 > but there are no more locks to release! > This is strange. I don't see how that can happen nor how my change would have caused this regression. If anything, the lock chance may have brought a bug in stack file ops to light, but don't see the bug. The repro is multi-threaded but when I ran the repro, a single thread did: - open lower file (pre copy up) - lchown file (copy up) - llseek the open file (so llseek is on a temporary ovl_open_realfile()) Perhaps when bug was triggered ops above were executed by different threads? Dmitry, I may have asked this before - how hard would it be to attach an strace of the repro to a bug report? Thanks, Amir.