Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2268047ybf; Mon, 2 Mar 2020 05:24:36 -0800 (PST) X-Google-Smtp-Source: APXvYqzQ2UKfslfw1ByDmtGmR6M8+3WVcGyi7wXiC9mAXrXCU4/Iyv0T+OIzS+kPLD4xlOjrz3zq X-Received: by 2002:aca:170c:: with SMTP id j12mr5544854oii.50.1583155476604; Mon, 02 Mar 2020 05:24:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583155476; cv=none; d=google.com; s=arc-20160816; b=hk4dupOnjLbUBoMkTlG1aJFHXkmpXJKJih1uWFB/+RbP3xD/m6QDcoJLwLXvl3zVRU Lo8iUc2Tx+HBGeXD2+9caVFVSIP78QiQu/PABY5HBZCIHZ3QN7uCDD84RNVW8W9ZK0ae eP25Mra+le03pM9C6d1QVMNKHipkw01KhyprcNVPdJPDFjGnmjIW/tovU3TOIpLR23wQ 1vzXfJ5lLwjch/dpEYzindoOJePWbrTuqnRtduojZyxw/FB4qxJYHMI1dgOM9Nh7pZRp YxspZTRs8c34+cpm/t/jfhncBofm41bcOWoiNLUS5c3C6ZiwYQI9EmoNBbj5ksygwpKq a/WQ== 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=iOAD9+MdORb/Grg4ortMCpfAyFSLoych0vXLlv3nkY8=; b=yE6YzyEJZTNGZKS4gj4XZwsIJciL5QZYYtYMbiKwiDb+LkqDAaZHOheHxcCNZwpDUG g3+2JGU6J4mD5pwyXRw64r4D03X4hhJKlS71mwl5LyxzXCxwd/n7nL6oszGGowWn19zs A24VXTrrRBgn2fiPH1L1x14GIRy5tgIvb5Y7mO/OHXHVoAAh/d8NKATY9Q/5ykcvZgP3 wt6+/6Nchm9Mpx7d5UA6mJ6LrlvU6cMNmUNVWksvsI9ECuZeShRgRx49eQXMLAy8aFFL +goopowVYplXJ9bH5Izs9/XHxMon6RUBCf4jGWtC5EzO7ZGW0kwsIRKL3a9T326oFJr5 fU1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vLt2I3B+; 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 o18si6525630otk.80.2020.03.02.05.24.24; Mon, 02 Mar 2020 05:24:36 -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=vLt2I3B+; 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 S1727869AbgCBNYN (ORCPT + 99 others); Mon, 2 Mar 2020 08:24:13 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:46710 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727361AbgCBNYN (ORCPT ); Mon, 2 Mar 2020 08:24:13 -0500 Received: by mail-io1-f68.google.com with SMTP id x21so6928686iox.13; Mon, 02 Mar 2020 05:24:12 -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=iOAD9+MdORb/Grg4ortMCpfAyFSLoych0vXLlv3nkY8=; b=vLt2I3B+FU2rLWmITK2V8QAaAVs8MKVbM3akA0p+u03JnJPXIhdkloZ1eATbO8OSTa dtCCV865P3KhUPAid0FxOxnXrG9SMm5aaBNufjqOEXhBH4lB6KQX0ZQUt4AtdXUZJ6Vp zk9Qdi8Wy8Elyr99oECBcGektmX4fpNv052JKzGHqgNr+kFLhwlZbMxa8crBnFFOmrZL bOqq92oat4ljtAl8xKSnDl4+NTteO/gfLIULizJ+bUTFYlDsjpYbgARQcboakK3A7w0B nweeGRxjIAAlDANlimeicMtSZ5U4V9riktSO+o4qamWRLj51quf4gZ2V8B0zdDYr0GC3 +ZZQ== 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=iOAD9+MdORb/Grg4ortMCpfAyFSLoych0vXLlv3nkY8=; b=XK6T0nTXwjN0Tt82bruTwcvR4jawiSiNDN5dVhS8NM5DVp5IKP0Rv2u1XSC+aCFy24 Bssg8xtC9PCP0qvLOQ0PWecOqOs1ik3ftb1RBqACg2adeD9KVmqLxMm542iWIxCa7Xsj EXO5rVo+D6XN/rQAjmtJ4qJjd/HNIom3Z1M9sjO84IHSZ5fy5L7WpqdfGVzRkvek7o2D +RIAOh7h1gGWSp4EDbqvrLIAACK+fTEJjujCSMw7wVUfdGuo+2K2ZCv87MT2t/8CQlM3 2Or1Ov8u1OdQ+l+ZNR+o7yhyhbcbpfMGOj2kwyDpmjTiYwNk/Y2DMw7ajTrwzJ2DOe+R PTPg== X-Gm-Message-State: APjAAAXANp7K8O6xUSQM55UbnITS9iXZHiQ2eki70sPQJqthajNszn9k +NQCpiREt5KbfXZSBBXknFwQg+uPz6xMIQvKgVPj7uc3 X-Received: by 2002:a5e:8507:: with SMTP id i7mr6889525ioj.9.1583155452284; Mon, 02 Mar 2020 05:24:12 -0800 (PST) MIME-Version: 1.0 References: <000000000000d3e319059fcfdc98@google.com> In-Reply-To: From: Amir Goldstein Date: Mon, 2 Mar 2020 15:24:01 +0200 Message-ID: Subject: Re: WARNING: bad unlock balance in ovl_llseek To: Dmitry Vyukov Cc: syzbot , 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 Mon, Mar 2, 2020 at 2:35 PM Dmitry Vyukov wrote: > > On Mon, Mar 2, 2020 at 1:10 PM Amir Goldstein wrote: > > > > 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. > > > > > > Hi Amir, > > > > > > This is not strange in the context of fuzzer, it's goal is to pass > > > random data. Generally if it says 0x400000ul, that's what it is, don't > > > fix it, or you are running a different program that may not reproduce > > > the bug. If syzbot attaches a reproducer, the bug was triggered by > > > precisely this program. > > > > > > > What's strange it that a bug in overlay code cannot be triggered if overlay > > isn't mounted and as it is the repro couldn't mount overlayfs at all, at > > lease with my kernel config. > > Can it depend on kernel config? The bug was triggered by the program > provided somehow. I am not sure. I do not have CONFIG_HARDENED_USERCOPY set. > > Separate question: why is it failing? Isn't src unused for overlayfs? > Where/how does vfs code look at src? > SYSCALL_DEFINE5(mount, ... copy_mount_string(dev_name) strndup_user() memdup_user() copy_from_user() Not in overlayfs code. Actually, the source (dev) is not used by overlayfs but is visible at /proc/mounts. Thanks, Amir.