Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4723416pxu; Tue, 13 Oct 2020 05:49:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuHqZD1L4wo5JcC2AJvj+0E7fqy8kQ5FN7UUAl93bYOlLlY/o3aUcDPV6bRaZFGFjpwQ/i X-Received: by 2002:a17:906:4b1a:: with SMTP id y26mr21753631eju.350.1602593381829; Tue, 13 Oct 2020 05:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602593381; cv=none; d=google.com; s=arc-20160816; b=QQpKOjm7sQL7TkZazxQ4ZU9W9XCidfJATkYyJb8ydx90PNHS0LGCiUJm3zQ8HPGgTk NCthxkC1xtNbjl8wI3nRw7DUGf7nXX6ovyu1LltTlDKBUgGbGVLqH3eZLl8vY09pufCm fHc6mLeKva3pLFuIRvd0tH7fn9r6X48vk77q/D/Mj2JQyVj99xskgBkqLcvNzRQ2DsCG lx9Dsd9Jh0ILOg5DJJqCcIj34ddkbZ6DRjfiGiFzkGFZsqfMfttgcZfSJNVMWpwfgt1a Zc4Tr9QI5SJxFUecJ6gWEsVFUOuomd+c6m0TqEfKoALy2M1TqFdAFiJQw2pjD6ssj2ZK ShwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=//NcQlq5UsHGgbWgeHzty5MaRuyItJz9yI1g6VbhS+U=; b=vkcjJ/9MEGJSTJJqOXmbz2biW8fgEKfUY7nYQSOoHtxQjfKeYKJeCm9fm33vWMzomU HSwruA6yK3A7ABzYzMNJrkInJQNVrjRMp9gd2vj+EiQSw1tkdqgaU1ywekIsYp2Vlge/ kwQ00jsdrQ9eKFfS2BhBsM6Kns0NKGe+lyP+qnwkqYPm4w8HOCAFulr1fkrWSVomQF9A c2CcMyANOXZ5ReCbbn4FGRXeXoumvJhUsqga/bh025+WAQ1Wztwrultd5S4CorcmeyeT qgWQsDNymc1iDZq+ythdcAClepepj6T9ljO39wazB4HIu+ANSc9wLhUYUuIuP/qVZ4D7 IseA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Dib6y0SB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id d21si7140550ejr.160.2020.10.13.05.49.19; Tue, 13 Oct 2020 05:49:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Dib6y0SB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731587AbgJLUzw (ORCPT + 99 others); Mon, 12 Oct 2020 16:55:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbgJLUzv (ORCPT ); Mon, 12 Oct 2020 16:55:51 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF226C0613D0; Mon, 12 Oct 2020 13:55:51 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id c20so4166354pfr.8; Mon, 12 Oct 2020 13:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=//NcQlq5UsHGgbWgeHzty5MaRuyItJz9yI1g6VbhS+U=; b=Dib6y0SBrim3s4+CNlW2upCAfeDyiE+FCezdLI2j6DZQhSyguR+u/pchuOutRzSUG6 ow5YygHC7KiOvtE5663dR0t5lNMtCgl03lz6JgiQYzb5ZpD3HxRbSCiXK4zZ4ZYWccvG 41U5D1E2MeisrnXi/Pi2GJLlPNI6Xt768+UdX7gut7ixx1WDqa5Fpgw0Vh2yj0xMa0xo aNIcPnk2ahclhHWxpJLwNsNa60Wa5ajqUpRILEOepyJT73PeFszlRkYiuWtDAM2GfJKd TX9Kv3F+4ZOfVKumZwBELSAih4LASxud4JomMP2Pd5S2OPrXhpKLQVAVmkS/G1eepgho VEcw== 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:content-transfer-encoding :in-reply-to; bh=//NcQlq5UsHGgbWgeHzty5MaRuyItJz9yI1g6VbhS+U=; b=nAOZlyuQYhlopBKF87weeADfvMsYnJjaOpjr+bw9d0a8Loz9cER7i2Ygw/vRgaG3k/ AeHGzEotnB/zKMT+dmrszN8NCQ6cC8Ztyb/NHS0zlqLJFOIuvdJJJA5z9d3MclYBbMXa NNDRElh0yWXFx3+fxl6MRxBTDXrO+o6epU9Z/UfWQ0x4yO6ew0TGpeNP8EkoMNvnlsI7 MkBs49LtlQXmBXWUXx0AOQHCnTuPFDq8oLCy4DX62YhMHH9SqsgwO2M4Tn4SNnrDbH3L gqjhfPUwMgX9h/pGx+fIQkZOBe+QXLXohZiDuEIRuh/kXv7YyrkdQHAhTAw50rSY+SCG XiFQ== X-Gm-Message-State: AOAM533AHhqDXX0yprXMCN+agBQwoURpjHEL/Bun3XPBofXLEGB4mySg 0PFnW2g0wSz3IOcqtEO4ggI= X-Received: by 2002:a17:90a:fa48:: with SMTP id dt8mr7946949pjb.108.1602536151279; Mon, 12 Oct 2020 13:55:51 -0700 (PDT) Received: from thinkpad (104.36.148.139.aurocloud.com. [104.36.148.139]) by smtp.gmail.com with ESMTPSA id r16sm24932904pjo.19.2020.10.12.13.55.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 13:55:50 -0700 (PDT) Date: Mon, 12 Oct 2020 13:56:50 -0700 From: Rustam Kovhaev To: dsterba@suse.cz, Dmitry Vyukov , Chris Mason , dsterba@suse.com, Josef Bacik , linux-btrfs@vger.kernel.org, LKML , syzkaller-bugs Cc: gregkh@linuxfoundation.org Subject: Re: KASAN: use-after-free Read in btrfs_scan_one_device Message-ID: <20201012205650.GA1180751@thinkpad> References: <0000000000001fe79005afbf52ea@google.com> <20200930165756.GQ6756@twin.jikos.cz> <20200930180522.GR6756@twin.jikos.cz> <20201001133546.GV6756@twin.jikos.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201001133546.GV6756@twin.jikos.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 01, 2020 at 03:35:46PM +0200, David Sterba wrote: > On Thu, Oct 01, 2020 at 03:08:34PM +0200, Dmitry Vyukov wrote: > > On Thu, Oct 1, 2020 at 3:05 PM Dmitry Vyukov wrote: > > > > > > On Wed, Sep 30, 2020 at 8:06 PM David Sterba wrote: > > > > > > > > On Wed, Sep 30, 2020 at 06:57:56PM +0200, David Sterba wrote: > > > > > On Sun, Sep 20, 2020 at 07:12:14AM -0700, syzbot wrote: > > > > > > Hello, > > > > > > > > > > > > syzbot found the following issue on: > > > > > > > > > > > > HEAD commit: eb5f95f1 Merge tag 's390-5.9-6' of git://git.kernel.org/pu.. > > > > > > git tree: upstream > > > > > > console output: https://syzkaller.appspot.com/x/log.txt?x=10a0a8bb900000 > > > > > > kernel config: https://syzkaller.appspot.com/x/.config?x=ffe85b197a57c180 > > > > > > dashboard link: https://syzkaller.appspot.com/bug?extid=582e66e5edf36a22c7b0 > > > > > > compiler: gcc (GCC) 10.1.0-syz 20200507 > > > > > > > > > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > > > > > > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > > > > > Reported-by: syzbot+582e66e5edf36a22c7b0@syzkaller.appspotmail.com > > > > > > > > > > #syz fix: btrfs: fix overflow when copying corrupt csums for a message > > > > > > > > Johannes spotted that this is not the right fix for this report, I don't > > > > know how to tell syzbot to revert the 'fix:' command, there isn't > > > > 'unfix' (like there's 'undup'). > > > > > > Hi David, > > > > > > I've added "unfix" command: > > > https://github.com/google/syzkaller/pull/2156 > > > > > > Let's give it a try: > > > #syz unfix > > > > > > Thanks > > > > Voilà! Unfixed: > > https://syzkaller.appspot.com/bug?extid=582e66e5edf36a22c7b0 > > Thanks! the problem is that btrfs_kill_super() frees *fs_info while it is still being referenced by btrfs_scan_one_device() on behalf of another concurrent mount syscall a very simple and dumb fix is to remove that printk that references *fs_info: https://syzkaller.appspot.com/text?tag=Patch&x=123537fb900000 but instead, i think proper synchronization is needed here any advice or pointers would be highly appreciated tyvm!